You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Scala 2.13.0 the example above unexpectely prints null. Making Foo1 a trait or Foo2 something else than an object solves the issue. The example works as expected in Scala 2.12.10.
The text was updated successfully, but these errors were encountered:
The problem is that the first statement in object Foo2 is a new. The implementation fails to tell this apart from the super call, and puts it in the wrong place. The following works correctly (added a println):
traitFoo {
traitBar {
println(Foo.this)
}
}
abstractclassFoo1extendsFooobjectFoo2extendsFoo1 {
println("statement after the super call")
newBar {}
}
Foo2
In Scala 2.13.0 the example above unexpectely prints
null
. MakingFoo1
a trait orFoo2
something else than an object solves the issue. The example works as expected in Scala 2.12.10.The text was updated successfully, but these errors were encountered: