New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash with higher kinded types in patterns, depends on order of scalac args #4070
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4070?orig=1 |
@adriaanm said: 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: |
@TiarkRompf said: // 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: 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: |
@paulp said: |
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
The text was updated successfully, but these errors were encountered: