summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-01-23 01:30:10 -0800
committerJames Iry <jamesiry@gmail.com>2013-01-23 01:51:35 -0800
commitd592216a12d8bd145f6a670554e9217944c2b169 (patch)
tree15d100471f7388c868491dbcb5d4c928c9232f62 /src/compiler/scala/tools/nsc/transform/LambdaLift.scala
parent884737c75dc7f2765a3d769342ecc832deeddb81 (diff)
downloadscala-d592216a12d8bd145f6a670554e9217944c2b169.tar.gz
scala-d592216a12d8bd145f6a670554e9217944c2b169.tar.bz2
scala-d592216a12d8bd145f6a670554e9217944c2b169.zip
SI-7011 Fix finding constructor type in captured var definitions
If a captured var was initialized with an empty tree then finding the type of the empty tree was being handled improperly. The fix is to look for primary constructors on the tree's type symbol rather than the tree's symbol. A test is included. In order to make the problem more testable the debug logging of the issue is changed to a debug warn.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/LambdaLift.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/LambdaLift.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
index 4a23e65ad2..c59d0b5b27 100644
--- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
+++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
@@ -430,10 +430,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