Affects Version/s: None
Fix Version/s: Scala 2.11.0
In GenICode the definition of adapt has several questionable cases that do not seem reachable. Need to investigate and either comment why they are necessary and add tests, or remove them if they are dead code.
This defines conforms as either a subtype relation or the case when from is null and to is nothing. When would we have a null when we expect nothing?
val conforms = (from <:< to) || (from == NullReference && to == NothingReference)
This is saying if we have a throwable and a non-throwable is expected then we should emit a cast? Why would we get here?
case ThrowableReference if !(ThrowableClass.tpe <:< to.toType) => ctx.bb.emit(CHECK_CAST(to)) // downcast throwables
And why do we need this special case? It's saying that from conformed with to, but that to is a LONG and from was int sized but that shouldn't happen, because conforms is defined as the subtype relation <:< and INT isn't a subtype of LONG however, removing it breaks test/files/run/t107.scala
case _ => // widen subrange types if (from.isIntSizedType && to == LONG) coerce(INT, LONG)