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
$ cat uncurry-bug.scala
traitCtx {
traitTree
}
traitLst[+A] {
defzip[A1>:A, B](that: Lst[B]):Nothing
}
objectTest {
/* * Question: * * Is it by design that there is a difference * between the behavior of scalac on the following * two methods, which only differ in the type param:*/deffoo1(c: Ctx)(l: Lst[c.Tree]) = l zip l
deffoo2[T](c: Ctx)(l: Lst[c.Tree]) = l zip l
}
sun@sun-cpu:~/workspace/dev-2.11/scala/sandbox(2.11.x)$ scalac -version
Scala compiler version 2.11.6-20150224-172222-092690e7bf --Copyright2002-2013, LAMP/EPFL
sun@sun-cpu:~/workspace/dev-2.11/scala/sandbox(2.11.x)$ scalac uncurry-bug.scala -Xprint:uncurry
[[syntax trees at end of uncurry]] // uncurry-bug.scalapackage<empty> {
abstracttraitCtxextendsObject {
def/*Ctx*/$init$():Unit= {
()
};
abstracttraitTreeextendsObject
};
abstracttraitLst[+A] extendsObject {
defzip[A1>:A, B](that: Lst[B]):Nothing
};
objectTestextendsObject {
def<init>():Test.type= {
Test.super.<init>();
()
};
deffoo1(c: Ctx, l: Lst[Ctx#Tree]):Nothing= {
<synthetic> vall$1:Lst[Ctx#Tree] = l.asInstanceOf[Lst[Ctx#Tree]]();
l$1.zip[c.Tree, c.Tree](l$1)
};
deffoo2[T](c: Ctx, l: Lst[c.Tree]):Nothing= l.zip[c.Tree, c.Tree](l)
}
}
Notice the two signatures after uncurry:
I would say the 2nd one is incorrect, as it doesn't widen. Or is that a design decision?
The text was updated successfully, but these errors were encountered: