Permalink
Browse files

Merge pull request #1956 from JamesIry/SI-7011_2.10.x

SI-7011 Fix finding constructor type in captured var definitions
  • Loading branch information...
2 parents 3753efc + d592216 commit 2fa859e1b3eb2ac57058feaba87d96adfbac9209 @JamesIry JamesIry committed Jan 25, 2013
View
4 src/compiler/scala/tools/nsc/transform/LambdaLift.scala
@@ -443,10 +443,10 @@ abstract class LambdaLift extends InfoTransform {
/* Creating a constructor argument if one isn't present. */
val constructorArg = rhs match {
case EmptyTree =>
- sym.primaryConstructor.info.paramTypes match {
+ sym.tpe.typeSymbol.primaryConstructor.info.paramTypes match {
case List(tp) => gen.mkZero(tp)
case _ =>
- log("Couldn't determine how to properly construct " + sym)
+ debugwarn("Couldn't determine how to properly construct " + sym)
rhs
}
case arg => arg
View
1 test/files/pos/t7011.flags
@@ -0,0 +1 @@
+-Ydebug -Xfatal-warnings
View
7 test/files/pos/t7011.scala
@@ -0,0 +1,7 @@
+object bar {
+ def foo {
+ lazy val x = 42
+
+ {()=>x}
+ }
+}

0 comments on commit 2fa859e

Please sign in to comment.