diff options
author | Martin Odersky <odersky@gmail.com> | 2016-01-30 01:36:22 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-09 09:40:52 +0100 |
commit | 1cc4d90627907a17172f7e8129003f9e9cb0cdf4 (patch) | |
tree | cc741fef3ca3cc87a6e48a7309156df2b055503d /src/dotty/tools/dotc | |
parent | 41f056750990a2e6391eec3436077715041d2b8a (diff) | |
download | dotty-1cc4d90627907a17172f7e8129003f9e9cb0cdf4.tar.gz dotty-1cc4d90627907a17172f7e8129003f9e9cb0cdf4.tar.bz2 dotty-1cc4d90627907a17172f7e8129003f9e9cb0cdf4.zip |
Move scala2Mode test from isStable to isRealizable
This prepares the way for using isRealizable in different contexts.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 9a432829b..3a66e10d4 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -522,9 +522,7 @@ object SymDenotations { final def isStable(implicit ctx: Context) = { val isUnstable = (this is UnstableValue) || - is(Lazy, butNot = Module) && - !(info.isRealizable || ctx.scala2Mode) && - !hasAnnotation(defn.UncheckedStableAnnot) + is(Lazy, butNot = Module) && !info.isRealizable && !hasAnnotation(defn.UncheckedStableAnnot) (this is Stable) || isType || { if (isUnstable) false else { setFlag(Stable); true } diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 1d4e80601..db0831ba0 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -138,10 +138,12 @@ object Types { case tp: AndOrType => isConcrete(tp.tp1) && isConcrete(tp.tp2) case _ => false } - isConcrete(tp) && tp.abstractTypeMembers.forall { m => + isConcrete(tp) && + tp.abstractTypeMembers.forall { m => val bounds = m.info.bounds bounds.lo <:< bounds.hi - } + } || + ctx.scala2Mode } /** Does this type refer exactly to class symbol `sym`, instead of to a subclass of `sym`? |