aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-12 16:52:48 +0100
committerMartin Odersky <odersky@gmail.com>2014-03-12 16:52:48 +0100
commitc90044f7ab4f2ab11a047d25c7430c48b930e82d (patch)
tree6af7fa12e56c49c843fc458c5c0dd57f2ed55533 /src/dotty/tools/dotc/core/TypeOps.scala
parentaf337f0667fa559411f9a96355b9ceeabf95b232 (diff)
downloaddotty-c90044f7ab4f2ab11a047d25c7430c48b930e82d.tar.gz
dotty-c90044f7ab4f2ab11a047d25c7430c48b930e82d.tar.bz2
dotty-c90044f7ab4f2ab11a047d25c7430c48b930e82d.zip
Added lost comment to isVolatile.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 15e3021a2..152f8d1b7 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -76,6 +76,22 @@ trait TypeOps { this: Context =>
def apply(tp: Type) = simplify(tp, this)
}
+ /** A type is volatile if its DNF contains an alternative of the form
+ * {P1, ..., Pn}, {N1, ..., Nk}, where the Pi are parent typerefs and the
+ * Nj are refinement names, and one the 4 following conditions is met:
+ *
+ * 1. At least two of the parents Pi are abstract types.
+ * 2. One of the parents Pi is an abstract type, and one other type Pj,
+ * j != i has an abstract member which has the same name as an
+ * abstract member of the whole type.
+ * 3. One of the parents Pi is an abstract type, and one of the refinement
+ * names Nj refers to an abstract member of the whole type.
+ * 4. One of the parents Pi is an an alias type with a volatile alias
+ * or an abstract type with a volatile upper bound.
+ *
+ * Lazy values are not allowed to have volatile type, as otherwise
+ * unsoundness can result.
+ */
final def isVolatile(tp: Type): Boolean = {
/** Pre-filter to avoid expensive DNF computation