Skip to content

Commit c90044f

Browse files
committed
Added lost comment to isVolatile.
1 parent af337f0 commit c90044f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: src/dotty/tools/dotc/core/TypeOps.scala

+16
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ trait TypeOps { this: Context =>
7676
def apply(tp: Type) = simplify(tp, this)
7777
}
7878

79+
/** A type is volatile if its DNF contains an alternative of the form
80+
* {P1, ..., Pn}, {N1, ..., Nk}, where the Pi are parent typerefs and the
81+
* Nj are refinement names, and one the 4 following conditions is met:
82+
*
83+
* 1. At least two of the parents Pi are abstract types.
84+
* 2. One of the parents Pi is an abstract type, and one other type Pj,
85+
* j != i has an abstract member which has the same name as an
86+
* abstract member of the whole type.
87+
* 3. One of the parents Pi is an abstract type, and one of the refinement
88+
* names Nj refers to an abstract member of the whole type.
89+
* 4. One of the parents Pi is an an alias type with a volatile alias
90+
* or an abstract type with a volatile upper bound.
91+
*
92+
* Lazy values are not allowed to have volatile type, as otherwise
93+
* unsoundness can result.
94+
*/
7995
final def isVolatile(tp: Type): Boolean = {
8096

8197
/** Pre-filter to avoid expensive DNF computation

0 commit comments

Comments
 (0)