Closed scabug closed 12 years ago
Imported From: https://issues.scala-lang.org/browse/SI-4070?orig=1 Reporter: @TiarkRompf
@adriaanm said: I have a fix for the immediate cause (see https://github.com/adriaanm/scala/tree/ticket/4070), but that revealed that a full fix will require higher-kinded existentials, which are a pending enhancement.
I haven't investigating yet why compilation order matters, but I suspect the bug is rather that the other way around somehow masks the problem that you see in the order that reveals the crash.
@adriaanm said: of course i should have investigated why compilation order matters first -- pursuing a fix for that, hoping it doesn't cause any spurious cyclic errors
@TiarkRompf said: There seems to be another related error:
// file DeliteOps.scala
trait DeliteOpMap[A,B,C[X] <: DeliteCollection[X]] extends DeliteOp[C[B]] with DeliteOpMapLikeWhileLoopVariant {
val in: Exp[C[A]]
val v: Sym[A]
val func: Exp[B]
val alloc: Exp[C[B]]
...
}
// file DeliteGenTaskGraph.scala
case map: DeliteOpMap[_,_,_] => ... gen.remap(map.alloc.Type) ...
Depending on compilation order, this throws an exception "head of empty list at Infer.scala 1029". This kind of error is rather unfortunate because it makes using IDEs very brittle (workaround: comment, make, uncomment, make, sigh).
@paulp said: Here it is minimized a ways, and with only one source file. It's still order-dependent: if you move the class definitions before the method definition, it no longer crashes. Which is more than a little scary all by itself.
trait Foo {
def crash(x: Dingus[_]) = x match { case m: Bippy[tv] => }
class Dingus[T]
class Bippy[CC[X] <: Seq[X]]() extends Dingus[CC[Int]]
}
It's easy enough to make this stop crashing, but not so easy to fix it without existential type constructors. I had a vision that adriaan will fix it.
@adriaanm said: for the record, suggested workaround: replace _ by Any
@paulp said: I can't crash it this way anymore as of f39537a369 , tiark please let me know if it's still an issue.
What steps will reproduce the problem (please be specific and use wikiformatting)?
There is no error if the order of the arguments is reversed!
File ACompileFirst.scala:
File BCompileSecond.scala:
What is the expected behavior? Compiling without error.
What do you see instead?
When constructing a TypeVar for
creatingThisTypeVarFails
, typeArgs isList(?_)
but params is empty. Assertivity ensues:What versions of the following are you using? Scala:r23727 Java:1.6.0_20 Operating system: Mac 10.6