diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-26 12:04:38 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-06 11:04:54 +0200 |
commit | 3d241f3ddbb1d364d163612f643adb57b355f554 (patch) | |
tree | 66954605a96d5df687fc00783a009842def61abd /src/dotty/tools/dotc/core/Types.scala | |
parent | bf203a52ef0933498a88c2c60e4dad6005bf51cb (diff) | |
download | dotty-3d241f3ddbb1d364d163612f643adb57b355f554.tar.gz dotty-3d241f3ddbb1d364d163612f643adb57b355f554.tar.bz2 dotty-3d241f3ddbb1d364d163612f643adb57b355f554.zip |
More inclusive isStable test.
(1) Refinements of stable types are stable
(2) TypeVars instantiated to stable types are stable.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 8825f396d..6b46e475b 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -89,9 +89,10 @@ object Types { final def isValueType: Boolean = this.isInstanceOf[ValueType] /** Does this type denote a stable reference (i.e. singleton type)? */ - final def isStable(implicit ctx: Context): Boolean = this match { + final def isStable(implicit ctx: Context): Boolean = stripTypeVar match { case tp: TermRef => tp.termSymbol.isStable && tp.prefix.isStable case _: SingletonType => true + case tp: RefinedType => tp.parent.isStable case NoPrefix => true case _ => false } |