aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-10-31 17:33:00 +0100
committerMartin Odersky <odersky@gmail.com>2016-10-31 17:33:00 +0100
commit1dea9916e686adc96df9d7886346af2ed1abe45f (patch)
treee97b68171788ead972962bd17a59fd560296098d /src/dotty/tools/backend
parent01ae7ddfd4956660ed4897f5d2773587f845204c (diff)
downloaddotty-1dea9916e686adc96df9d7886346af2ed1abe45f.tar.gz
dotty-1dea9916e686adc96df9d7886346af2ed1abe45f.tar.bz2
dotty-1dea9916e686adc96df9d7886346af2ed1abe45f.zip
Fix #1637: Future defs are always OK
Drop special mode that handles future defs without which we get DenotationNotDefinedHere errors. In more than a year, this has only turned up false negatives. So I think it's better to drop the check, and the contortions needed to deal with it.
Diffstat (limited to 'src/dotty/tools/backend')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 2d60d851c..03c4315fe 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -647,21 +647,16 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
def rawowner: Symbol = {
originalOwner
}
- def originalOwner: Symbol = {
+ def originalOwner: Symbol =
// used to populate the EnclosingMethod attribute.
// it is very tricky in presence of classes(and annonymous classes) defined inside supper calls.
- try {
- if (sym.exists) {
- val original = toDenot(sym).initial
- val validity = original.validFor
- val shiftedContext = ctx.withPhase(validity.phaseId)
- val r = toDenot(sym)(shiftedContext).maybeOwner.lexicallyEnclosingClass(shiftedContext)
- r
- } else NoSymbol
- } catch {
- case e: NotDefinedHere => NoSymbol // todo: do we have a method to tests this?
- }
- }
+ if (sym.exists) {
+ val original = toDenot(sym).initial
+ val validity = original.validFor
+ val shiftedContext = ctx.withPhase(validity.phaseId)
+ val r = toDenot(sym)(shiftedContext).maybeOwner.lexicallyEnclosingClass(shiftedContext)
+ r
+ } else NoSymbol
def parentSymbols: List[Symbol] = toDenot(sym).info.parents.map(_.typeSymbol)
def superClass: Symbol = {
val t = toDenot(sym).asClass.superClass