diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-08 12:02:54 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-09 19:09:52 +0100 |
commit | df0229e4754e8d512aef68c7d2ffbd1d79cb5df5 (patch) | |
tree | bb51f4e29ec44d34b7e6fda479bfb990df887da0 /src/dotty | |
parent | fea26e104d202f3ac755f309d982af4d7ddd7bba (diff) | |
download | dotty-df0229e4754e8d512aef68c7d2ffbd1d79cb5df5.tar.gz dotty-df0229e4754e8d512aef68c7d2ffbd1d79cb5df5.tar.bz2 dotty-df0229e4754e8d512aef68c7d2ffbd1d79cb5df5.zip |
Retract of optimization in computeDenot
Needs a weakening of an assertion in assertErased
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 11 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/Erasure.scala | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 3953562b2..5d95fae76 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1175,8 +1175,15 @@ object Types { case d => if (d.validFor.runId != ctx.period.runId) loadDenot - else if (ctx.erasedTypes && lastSymbol != null) - denotOfSym(lastSymbol) // avoid keeping non-sym denotations after erasure; they violate the assertErased contract + // The following branch was used to avoid an assertErased error. + // It's idea was to void keeping non-sym denotations after erasure + // since they violate the assertErased contract. But the problem is + // that when seen again in an earlier phase the denotation is + // still seen as a SymDenotation, whereas it should be a SingleDenotation. + // That's why the branch is disabled. + // + // else if (ctx.erasedTypes && lastSymbol != null) + // denotOfSym(lastSymbol) else d.current } diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala index b51a2360e..0a34b9e7c 100644 --- a/src/dotty/tools/dotc/transform/Erasure.scala +++ b/src/dotty/tools/dotc/transform/Erasure.scala @@ -94,7 +94,8 @@ class Erasure extends Phase with DenotTransformer { thisTransformer => if (ctx.mode.isExpr) tree.tpe match { case ref: TermRef => - assert(ref.denot.isInstanceOf[SymDenotation], + assert(ref.denot.isInstanceOf[SymDenotation] || + ref.denot.isInstanceOf[UniqueRefDenotation], i"non-sym type $ref of class ${ref.getClass} with denot of class ${ref.denot.getClass} of $tree") case _ => } |