diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-10-28 23:10:12 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-10-28 23:21:33 +0100 |
commit | 2d9b65b8fce13166f7fd521e433e18039356c4db (patch) | |
tree | 280d753a3ca52c44a4f5dbc36285877e484650f3 /src/compiler/scala/tools/nsc/typechecker/Duplicators.scala | |
parent | 74297159f5c4df42dcf6289f4daea79e7d4f7bb4 (diff) | |
download | scala-2d9b65b8fce13166f7fd521e433e18039356c4db.tar.gz scala-2d9b65b8fce13166f7fd521e433e18039356c4db.tar.bz2 scala-2d9b65b8fce13166f7fd521e433e18039356c4db.zip |
Wider use and a new variant of typedPos.
It's safe to replace `localTyper.typed(atPos(pos)(tree))` with
`localTyper.typedPos(pos)(tree)` given that we're all in the
same cake and we'll get to the same `atPos`.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Duplicators.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Duplicators.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index 97e86d183e..aa507efe5a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -321,7 +321,9 @@ abstract class Duplicators extends Analyzer { // we use the symbol name instead of the tree name because the symbol may have been // name mangled, rendering the tree name obsolete // log(tree) - val t = super.typed(atPos(tree.pos)(Select(This(newClassOwner), tree.symbol.name)), mode, pt) + val t = super.typedPos(tree.pos, mode, pt) { + Select(This(newClassOwner), tree.symbol.name) + } // log("typed to: " + t + "; tpe = " + t.tpe + "; " + inspectTpe(t.tpe)) t @@ -331,7 +333,7 @@ abstract class Duplicators extends Analyzer { val tree1 = This(newClassOwner) // log("tree1: " + tree1) debuglog("mapped " + tree + " to " + tree1) - super.typed(atPos(tree.pos)(tree1), mode, pt) + super.typedPos(tree.pos, mode, pt)(tree1) case This(_) => debuglog("selection on this, plain: " + tree) @@ -368,7 +370,7 @@ abstract class Duplicators extends Analyzer { cases } - super.typed(atPos(tree.pos)(Match(scrut, cases1)), mode, pt) + super.typedPos(tree.pos, mode, pt)(Match(scrut, cases1)) case EmptyTree => // no need to do anything, in particular, don't set the type to null, EmptyTree.tpe_= asserts |