diff options
author | Martin Odersky <odersky@gmail.com> | 2016-01-30 20:01:14 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-09 09:40:52 +0100 |
commit | 7ccd02c2cd23e4187f3e3a378973704cecd6459a (patch) | |
tree | c1efbbb4b0f73cc94b83c011bbcdc1b34e34ff9b /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 1b7745e5f9c0e251436b33247133f3810838cf12 (diff) | |
download | dotty-7ccd02c2cd23e4187f3e3a378973704cecd6459a.tar.gz dotty-7ccd02c2cd23e4187f3e3a378973704cecd6459a.tar.bz2 dotty-7ccd02c2cd23e4187f3e3a378973704cecd6459a.zip |
Realizability refactoring
Distinguish between isStable and isRealizable.
Issue migration warnings for realizibility failures.
Provide error diagnostics why something is not realizable.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 3a66e10d4..fa199ab53 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -519,15 +519,15 @@ object SymDenotations { ) /** Is this a denotation of a stable term (or an arbitrary type)? */ - final def isStable(implicit ctx: Context) = { - val isUnstable = - (this is UnstableValue) || - is(Lazy, butNot = Module) && !info.isRealizable && !hasAnnotation(defn.UncheckedStableAnnot) - (this is Stable) || isType || { - if (isUnstable) false - else { setFlag(Stable); true } + final def isStable(implicit ctx: Context) = + isType || !is(UnstableValue, butNot = Stable) + + /** Is this a denotation of a realizable term (or an arbitrary type)? */ + final def isRealizable(implicit ctx: Context) = + is(Stable) || isType || { + val isRealizable = !is(Lazy, butNot = Module) || info.realizability == Realizable + isRealizable && { setFlag(Stable); true } } - } /** Is this a "real" method? A real method is a method which is: * - not an accessor |