diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-31 17:33:00 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-31 17:33:00 +0100 |
commit | 1dea9916e686adc96df9d7886346af2ed1abe45f (patch) | |
tree | e97b68171788ead972962bd17a59fd560296098d /src/dotty/tools/dotc/core/Definitions.scala | |
parent | 01ae7ddfd4956660ed4897f5d2773587f845204c (diff) | |
download | dotty-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/dotc/core/Definitions.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Definitions.scala | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 541d66306..62fa2d07d 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -633,14 +633,10 @@ class Definitions { name.startsWith(prefix) && name.drop(prefix.length).forall(_.isDigit) } - def isBottomClass(cls: Symbol) = cls == NothingClass || cls == NullClass - def isBottomType(tp: Type) = { - def test(implicit ctx: Context) = tp.derivesFrom(NothingClass) || tp.derivesFrom(NullClass) - try test - catch { // See remark in SymDenotations#accessWithin - case ex: NotDefinedHere => test(ctx.addMode(Mode.FutureDefsOK)) - } - } + def isBottomClass(cls: Symbol) = + cls == NothingClass || cls == NullClass + def isBottomType(tp: Type) = + tp.derivesFrom(NothingClass) || tp.derivesFrom(NullClass) def isFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.Function) def isAbstractFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.AbstractFunction) |