-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[[syntax trees at end of typer]] // tests/printing/i19019.scala | ||
package <empty> { | ||
final lazy module val ObjectWithSelf: ObjectWithSelf = new ObjectWithSelf() | ||
final module class ObjectWithSelf() extends Object() { | ||
this: ObjectWithSelf.type => | ||
final lazy module val StaticObjectNoSelf: ObjectWithSelf.StaticObjectNoSelf | ||
= new ObjectWithSelf.StaticObjectNoSelf() | ||
final module class StaticObjectNoSelf() extends Object() { | ||
this: ObjectWithSelf.StaticObjectNoSelf.type => | ||
def foo: Any = this | ||
} | ||
final lazy module val StaticObjectWithSelf: | ||
ObjectWithSelf.StaticObjectWithSelf = | ||
new ObjectWithSelf.StaticObjectWithSelf() | ||
final module class StaticObjectWithSelf() extends Object() { | ||
self: ObjectWithSelf.StaticObjectWithSelf.type => | ||
def foo: Any = self | ||
} | ||
class Container() extends Object() { | ||
final lazy module val NonStaticObjectNoSelf: | ||
Container.this.NonStaticObjectNoSelf = | ||
new Container.this.NonStaticObjectNoSelf() | ||
final module class NonStaticObjectNoSelf() extends Object() { | ||
this: Container.this.NonStaticObjectNoSelf.type => | ||
def foo: Any = this | ||
} | ||
final lazy module val NonStaticObjectWithSelf: | ||
Container.this.NonStaticObjectWithSelf = | ||
new Container.this.NonStaticObjectWithSelf() | ||
final module class NonStaticObjectWithSelf() extends Object() { | ||
self: Container.this.NonStaticObjectWithSelf.type => | ||
def foo: Any = self | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
object ObjectWithSelf: | ||
object StaticObjectNoSelf: | ||
def foo: Any = this | ||
end StaticObjectNoSelf | ||
|
||
object StaticObjectWithSelf: | ||
self => | ||
|
||
def foo: Any = self | ||
end StaticObjectWithSelf | ||
|
||
class Container: | ||
object NonStaticObjectNoSelf: | ||
def foo: Any = this | ||
end NonStaticObjectNoSelf | ||
|
||
object NonStaticObjectWithSelf: | ||
self => | ||
|
||
def foo: Any = self | ||
end NonStaticObjectWithSelf | ||
end Container | ||
end ObjectWithSelf |