summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-03-05 15:23:30 +0100
committerMartin Odersky <odersky@gmail.com>2012-03-05 15:23:30 +0100
commit0df343a0c614d6a7468105769568b2fba3f9b03c (patch)
tree34b4fbed500ec467baf7d1354f4b4d25363aed9a /src
parentbde711871a34d7987b8f7c090e7a7c12bdf58e22 (diff)
downloadscala-0df343a0c614d6a7468105769568b2fba3f9b03c.tar.gz
scala-0df343a0c614d6a7468105769568b2fba3f9b03c.tar.bz2
scala-0df343a0c614d6a7468105769568b2fba3f9b03c.zip
Now spots double definition after erasure errors involving value classes.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index e0086dd81b..f3cb50e5c4 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -702,6 +702,7 @@ abstract class Erasure extends AddInterfaces
* but their erased types are the same.
*/
private def checkNoDoubleDefs(root: Symbol) {
+ def afterErasure[T](op: => T): T = atPhase(phase.next.next)(op)
def doubleDefError(sym1: Symbol, sym2: Symbol) {
// the .toString must also be computed at the earlier phase
def atRefc[T](op: => T) = atPhase[T](currentRun.refchecksPhase.next)(op)
@@ -718,7 +719,7 @@ abstract class Erasure extends AddInterfaces
sym2 + ":" + atRefc(tpe2.toString) +
(if (sym2.owner == root) " at line " + (sym2.pos).line else sym2.locationString) +
"\nhave same type" +
- (if (atRefc(tpe1 =:= tpe2)) "" else " after erasure: " + atPhase(phase.next)(sym1.tpe)))
+ (if (atRefc(tpe1 =:= tpe2)) "" else " after erasure: " + afterErasure(sym1.tpe)))
sym1.setInfo(ErrorType)
}
@@ -728,7 +729,7 @@ abstract class Erasure extends AddInterfaces
if (e.sym.isTerm) {
var e1 = decls.lookupNextEntry(e)
while (e1 ne null) {
- if (atPhase(phase.next)(e1.sym.info =:= e.sym.info)) doubleDefError(e.sym, e1.sym)
+ if (afterErasure(e1.sym.info =:= e.sym.info)) doubleDefError(e.sym, e1.sym)
e1 = decls.lookupNextEntry(e1)
}
}