Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10694 from scala/tasty/test-classpath-standalone-obj
Align tasty file lookup with dotty, add test case
- Loading branch information
Showing
6 changed files
with
60 additions
and
3 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
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
10 changes: 10 additions & 0 deletions
10
test/tasty/run/src-2/tastytest/TestRuntimeSpecialClasses.scala
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,10 @@ | ||
package tastytest | ||
|
||
object TestRuntimeSpecialClasses extends Suite("TestRuntimeSpecialClasses") { | ||
test("consume standalone top-level object") { | ||
assert(new tastytest.Null$().res.head === 23) | ||
assert(new tastytest.Nothing$().res.head === 23) | ||
assert($.res.head === 23) | ||
assert(StandaloneObject.res.head === 23) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
test/tasty/run/src-3/tastytest/RuntimeSpecialClasses.scala
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,22 @@ | ||
package tastytest | ||
|
||
// makes Null$.class, and Null$.tasty | ||
class Null$ { | ||
def res: List[Int] = List(23) | ||
} | ||
|
||
// makes Nothing$.class, and Nothing$.tasty | ||
class Nothing$ { | ||
def res: List[Int] = List(23) | ||
|
||
} | ||
|
||
// makes $$.class, $.class, and $.tasty | ||
object $ { | ||
def res: List[Int] = List(23) | ||
} | ||
|
||
// makes StandaloneObject$.class, StandaloneObject.class, and StandaloneObject.tasty | ||
object StandaloneObject { | ||
def res: List[Int] = List(23) | ||
} |