diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-04 22:36:14 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-04 22:38:04 -0800 |
commit | b5eab2f3640f458d40f3e3cb87055e871af70947 (patch) | |
tree | c64d6dae427ec60950fd6a25b7f30abad0ceeaad /src | |
parent | 65ae85738cb2d14bb5e586417ccef352c3a268ac (diff) | |
download | scala-b5eab2f3640f458d40f3e3cb87055e871af70947.tar.gz scala-b5eab2f3640f458d40f3e3cb87055e871af70947.tar.bz2 scala-b5eab2f3640f458d40f3e3cb87055e871af70947.zip |
Made a typer hack less hacky.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ba3172dd06..66330d4321 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1610,8 +1610,6 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { * @param rhs ... */ def computeParamAliases(clazz: Symbol, vparamss: List[List[ValDef]], rhs: Tree) { - if (clazz eq AnyValClass) - return debuglog("computing param aliases for "+clazz+":"+clazz.primaryConstructor.tpe+":"+rhs)//debug def decompose(call: Tree): (Tree, List[Tree]) = call match { case Apply(fn, args) => @@ -1791,8 +1789,12 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { transformedOrTyped(ddef.rhs, EXPRmode, tpt1.tpe) } - if (meth.isPrimaryConstructor && meth.isClassConstructor && !isPastTyper && !reporter.hasErrors) - computeParamAliases(meth.owner, vparamss1, rhs1) + if (meth.isPrimaryConstructor && meth.isClassConstructor && !isPastTyper && !reporter.hasErrors) { + // At this point in AnyVal there is no supercall, which will blow up + // in computeParamAliases; there's nothing to be computed for Anyval anyway. + if (meth.owner ne AnyValClass) + computeParamAliases(meth.owner, vparamss1, rhs1) + } if (tpt1.tpe.typeSymbol != NothingClass && !context.returnsSeen && rhs1.tpe.typeSymbol != NothingClass) rhs1 = checkDead(rhs1) |