diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2005-06-24 09:55:08 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2005-06-24 09:55:08 +0000 |
commit | 00e3092afa5ef6c42196a35429e56b9cc8edbc51 (patch) | |
tree | f9d45073518acf41d9ea8a868483ed83171533d8 | |
parent | 8c15cfa18990081c50a563dc05a89556bc3bfcc1 (diff) | |
download | scala-00e3092afa5ef6c42196a35429e56b9cc8edbc51.tar.gz scala-00e3092afa5ef6c42196a35429e56b9cc8edbc51.tar.bz2 scala-00e3092afa5ef6c42196a35429e56b9cc8edbc51.zip |
Changes done by Martin to correcly typecheck La...
Changes done by Martin to correcly typecheck LabelDefs.
-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 = { |