diff options
-rwxr-xr-x | sources/scala/tools/nsc/typechecker/Typers.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/scala/tools/nsc/typechecker/Typers.scala b/sources/scala/tools/nsc/typechecker/Typers.scala index f931cd4606..d5c94046d9 100755 --- a/sources/scala/tools/nsc/typechecker/Typers.scala +++ b/sources/scala/tools/nsc/typechecker/Typers.scala @@ -557,8 +557,10 @@ abstract class Typers: Analyzer { } def typedLabelDef(ldef: LabelDef): LabelDef = { - val rhs1 = typed(ldef.rhs, UnitClass.tpe); - copy.LabelDef(ldef, ldef.name, ldef.params, rhs1) setType UnitClass.tpe + val restpe = ldef.symbol.tpe.resultType; + val rhs1 = typed(ldef.rhs, restpe); + ldef.params foreach (param => param.tpe = param.symbol.tpe); + copy.LabelDef(ldef, ldef.name, ldef.params, rhs1) setType restpe } def typedBlock(block: Block, mode: int, pt: Type): Block = { |