Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tasty-reader: support Scala 3.0.0-M3
- add changes to TASTy format 26.1 - test compat with cats-effect IOApp.Simple - substitute scala.Matchable for Any - test erasure of ValueOf from dotty
- Loading branch information
1 parent
0f64691
commit e91aa06
Showing
13 changed files
with
116 additions
and
5 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
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,22 @@ | ||
package tastytest | ||
|
||
/** test calling $init$ on IOApp parent */ | ||
object TestIOApp extends Suite("TestIOApp") { | ||
|
||
def randOver5 = scala.util.Random.nextInt(5) + 5 | ||
|
||
object Static extends IOApp.Simple { | ||
def run = assert(randOver5 >= 5) | ||
} | ||
|
||
test("static IOApp")(Static.run) | ||
|
||
test("local IOApp") { | ||
val Local = new IOApp.Simple { | ||
def run = assert(randOver5 >= 5) | ||
} | ||
Local.run | ||
} | ||
|
||
|
||
} |
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 TestMatchables extends Suite("TestMatchables") { | ||
|
||
test(assert(Matchables.foo == true)) | ||
test(assert(Matchables.bar("hello") === "hello")) | ||
test(assert(new Matchables.baz(23).a === 23)) | ||
test(assert(new Matchables.qux(5.0).a === 5.0)) | ||
|
||
} |
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,15 @@ | ||
package tastytest | ||
|
||
/** test calling $init$ on TraitInitsBase.SubTrait parent */ | ||
object TestTraitInitsBase extends Suite("TestTraitInitsBase") { | ||
|
||
object Static extends TraitInitsBase.SubTrait {} | ||
|
||
test("static SubTrait")(assert(Static.foo === 23)) | ||
|
||
test("local SubTrait") { | ||
val Local = new TraitInitsBase.SubTrait {} | ||
assert(Local.foo === 23) | ||
} | ||
|
||
} |
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,7 @@ | ||
package tastytest | ||
|
||
object TestValueOfErasure extends Suite("TestValueOfErasure") { | ||
|
||
test(assert(ValueOfErasure.reify[23] === 23)) | ||
|
||
} |
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 @@ | ||
package tastytest | ||
|
||
trait IOApp { | ||
protected val foo = 23 | ||
|
||
def run(args: List[String]): Int | ||
|
||
final def main(args: Array[String]): Unit = { | ||
sys.exit(run(args.toList)) | ||
} | ||
|
||
} | ||
|
||
object IOApp { | ||
trait Simple extends IOApp { | ||
def run: Unit | ||
|
||
final def run(args: List[String]): Int = { | ||
run | ||
0 | ||
} | ||
} | ||
} |
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,15 @@ | ||
package tastytest | ||
|
||
object Matchables { | ||
|
||
def foo: Matchable = true | ||
|
||
def bar[A <: Matchable](a: A) = a match { | ||
case a: A => a | ||
} | ||
|
||
class baz[A](val a: A) extends Matchable | ||
|
||
class qux[A <: Matchable](val a: A) | ||
|
||
} |
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,8 @@ | ||
package tastytest | ||
|
||
trait TraitInitsBase { | ||
val foo = 23 | ||
} | ||
object TraitInitsBase { | ||
trait SubTrait extends TraitInitsBase | ||
} |
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,5 @@ | ||
package tastytest | ||
|
||
object ValueOfErasure { | ||
def reify[I <: Int](implicit I: ValueOf[I]): I = valueOf[I] | ||
} |