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
Welcome to Scala version 2.8.1.final (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_22).
Type in expressions to have them evaluated.
Type:help for more information.
scala>classLift[T] {
|defapply[R](f: F0[R]):T=>R= f.f
||classF0[R](valf:T=>R)
|objectF0 {
|implicitdeff2f0[R](fn: T=>R):F0[R] =newF0(fn)
| }
| }
defined classLift
scala> (newLift[String])((_: String).length)
java.lang.AssertionError: assertion failed
at scala.Predef$$.assert(Predef.scala:77)
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:82)
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:45)
at scala.tools.nsc.ast.TreeGen.mkAttributedRef(TreeGen.scala:107)
at scala.tools.nsc.ast.TreeGen.mkAttributedStableRef(TreeGen.scala:149)
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:60)
The text was updated successfully, but these errors were encountered:
@paulp said:
I was going to say this is fixed in trunk, because it no longer crashes the repl. But while creating a test case to guard it I found it still crashes scalac.
In the repl a type error (and the type error looks right to me):
<console>:8:error: typemismatch;
found : (String) =>Intrequired: _1.F0[?] where val_1:Lift[String]
(newLift[String])((_: String).length)
^
Same crash outside.
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:82)
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:45)
at scala.tools.nsc.ast.TreeGen.mkAttributedRef(TreeGen.scala:107)
at scala.tools.nsc.ast.TreeGen.mkAttributedStableRef(TreeGen.scala:149)
at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:60)
classLift {
defapply(f: F0) {}
classF0objectF0 {
implicitdeff2f0(fn: String):F0=???
}
}
objectTest {
vall=newLiftvalf="""": l.FO// okay
(newLift).apply("") // fails trying to mkAttributedQualifier for pre = Skolem(_1 <: Lift with Singletom).F0// should this even have shown up in `companionImplicitMap`? It says that://// "@return For those parts that refer to classes with companion objects that// can be accessed with unambiguous stable prefixes, the implicits infos// which are members of these companion objects."
}
In Scala 2.8.1.final, the following definition causes the compiler to crash when compiling
(new Lift[String])((_: String).length)
:.
The session and stack trace:
The text was updated successfully, but these errors were encountered: