-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Using following source file all tests fail in Scala 3, and test with ScriptingContext[_] fails even with Scala 2:
type EvalFunction1[T] = scala.Function1[T, Any]
class ScriptingContext[X] {
def func(): Int = ???
def `then`(f: EvalFunction1[X]): ScriptingContext[Any] = ???
}
class SC extends ScriptingContext[Int]
test("Support generic classes") {
Surface.of[ScriptingContext[Int]]
val methods = Surface.methodsOf[ScriptingContext[Int]]
val methodNames = methods.map(_.name)
methodNames shouldContain "func"
methodNames shouldContain "then"
}
test("Support generic classes 2") {
Surface.of[SC]
val methods = Surface.methodsOf[SC]
val methodNames = methods.map(_.name)
methodNames shouldContain "func"
methodNames shouldContain "then"
}
test("Support generic classes 3") {
Surface.of[ScriptingContext[_]]
val methods = Surface.methodsOf[ScriptingContext[_]]
val methodNames = methods.map(_.name)
methodNames shouldContain "func"
methodNames shouldContain "then"
}
Scala 3 compile error are:
Found: wvlet.airframe.surface.i3418.EvalFunction1[X]
Required: wvlet.airframe.surface.i3418.EvalFunction1[Int]
And:
Found: wvlet.airframe.surface.i3418.EvalFunction1[X]
Required: wvlet.airframe.surface.i3418.EvalFunction1[
wvlet.airframe.surface.i3418.ScriptingContext[?]#X]
Metadata
Metadata
Assignees
Labels
No labels