aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-26 12:04:38 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-06 11:04:54 +0200
commit3d241f3ddbb1d364d163612f643adb57b355f554 (patch)
tree66954605a96d5df687fc00783a009842def61abd /src/dotty/tools/dotc/core/Types.scala
parentbf203a52ef0933498a88c2c60e4dad6005bf51cb (diff)
downloaddotty-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.scala3
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
}