diff options
author | Martin Odersky <odersky@gmail.com> | 2016-04-27 16:37:19 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-04-27 16:37:19 +0200 |
commit | 89b68608dda803398e16fa2146a1b94b7e59e04e (patch) | |
tree | 1611659bac6fda61c88e6071d659361662968990 /src | |
parent | 42b20d7143eb3da8dbe536ef990ceef4ec861b25 (diff) | |
download | dotty-89b68608dda803398e16fa2146a1b94b7e59e04e.tar.gz dotty-89b68608dda803398e16fa2146a1b94b7e59e04e.tar.bz2 dotty-89b68608dda803398e16fa2146a1b94b7e59e04e.zip |
Add FurtureDefsOK for isBottomType
Triggered by change in TypeComparer. I guess we should think of
dropping the NotDefiendHere tests, for a long time they gave us only false
negatives.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Definitions.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 9128bd3a5..7f59cbed0 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -605,7 +605,13 @@ class Definitions { } def isBottomClass(cls: Symbol) = cls == NothingClass || cls == NullClass - def isBottomType(tp: Type) = tp.derivesFrom(NothingClass) || tp.derivesFrom(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 isFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.Function) def isAbstractFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.AbstractFunction) |