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
@retronym said:
Another example from the mailing list:
scala>vale: java.lang.Enum[_] = java.util.concurrent.TimeUnit.SECONDS
scala> e match { case _ =>0 }
<console>:9:error: typearguments [_$1] do not conform to classEnum'stypeparameter bounds [E<:Enum[E]]
e match { case _ =>0 }
^
[[syntax trees at end of refchecks]] // <console>package$line4 {
object$readextends scala.AnyRef {
def<init>(): $line4.$read.type= {
$read.super.<init>();
()
};
object$iwextends scala.AnyRef {
def<init>():type= {
$iw.super.<init>();
()
};
object$iwextends scala.AnyRef {
def<init>():type= {
$iw.super.<init>();
()
};
private[this] valres0:Int= {
case <synthetic> valx1:Enum[_$1] = $line3.$read.$iw.$iw.e;
case4(){
matchEnd3(0)
};
matchEnd3(x: Int){
x
}
};
<stable> <accessor> defres0:Int= $iw.this.res0
}
}
}
}
This is somewhat related to #7694; the pattern matcher translation now happens before refchecks, and the TypeTree in the tpt of the synthetic temporary x1 is subject to bounds checking.
Upon entering this code into the REPL:
I get this error:
The code compiles on Scala 2.9.2, but fails on at least 2.10.0 and 2.10.2. Thus it appears to be a regression.
The text was updated successfully, but these errors were encountered: