Added the check against UnitClass in freeLocalsTraverser.

Closes SI-5245. Review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@26087 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
burmako 2011-11-29 15:25:45 +00:00
parent ed167e7120
commit 64aab2b68a
2 changed files with 4 additions and 1 deletions

View File

@ -226,7 +226,7 @@ abstract class LiftCode extends Transform with TypingTransformers {
val symClass = symTpe.typeSymbol
atPhase(phase.next) {
def refType(valueRef: Map[Symbol, Symbol], objectRefClass: Symbol) =
if (isValueClass(symClass)) valueRef(symClass).tpe
if (isValueClass(symClass) && symClass != UnitClass) valueRef(symClass).tpe
else appliedType(objectRefClass.typeConstructor, List(symTpe))
sym updateInfo (

View File

@ -0,0 +1,3 @@
object Foo {
def bar = { var x = (); def foo() = x }
}