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
object DepBug {
class A {
class B
def mkB = new B
def m(b: B) = b
}
trait Dep {
val a: A
val b: a.B
}
val dep = new {
val a = new A
val b = a mkB
}
def useDep(d: Dep) {
import d._
a m (b)
}
{
import dep._
a m (b)
}
dep.a m (dep b)
}
$ dotc abc.scala
-- Error: abc.scala ----------------------------------------------------------------------------------------------------
15 | def useDep(d: Dep) {
| ^
| '=' expected but '{' found
-- Error: abc.scala ----------------------------------------------------------------------------------------------------
19 | {
| ^
| '}' expected but '{' found
exception occurred while parsing abc.scala
exception occurred while compiling abc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:151)
at dotty.tools.dotc.util.Positions$Position$.start$extension(Positions.scala:40)
at dotty.tools.dotc.parsing.Parsers$Parser.simpleExprRest(Parsers.scala:1199)
at dotty.tools.dotc.parsing.Parsers$Parser.simpleExpr(Parsers.scala:1186)
at dotty.tools.dotc.parsing.Parsers$Parser$$anonfun$8.apply(Parsers.scala:1137)
at dotty.tools.dotc.parsing.Parsers$Parser$$anonfun$8.apply(Parsers.scala:1128)
at dotty.tools.dotc.parsing.Parsers$Parser.postfixExpr(Parsers.scala:1124)
<snipped>
The text was updated successfully, but these errors were encountered:
scalac can compile it but dotc crashes.
$ cat abc.scala
$ dotc abc.scala
The text was updated successfully, but these errors were encountered: