File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -437,13 +437,18 @@ class Definitions {
437
437
* to be the type parameters of a higher-kided type). This is a class symbol that
438
438
* would be generated by the following schema.
439
439
*
440
- * class LambdaXYZ { type v_1 Arg1; ...; type v_N ArgN; type Apply }
440
+ * class LambdaXYZ extends Object with P1 with ... with Pn {
441
+ * type v_1 $hk$Arg0; ...; type v_N $hk$ArgN;
442
+ * type Apply
443
+ * }
441
444
*
442
445
* Here:
443
446
*
444
- * - XYZ is a string of length N with one letter for each variant of a bound symbols,
445
- * using `P` (positive variance), `N` (negative variance), `I` (invariant).
446
447
* - v_i are the variances of the bound symbols (i.e. +, -, or empty).
448
+ * - XYZ is a string of length N with one letter for each variant of a bound symbol,
449
+ * using `P` (positive variance), `N` (negative variance), `I` (invariant).
450
+ * - for each positive or negative variance v_i there is a parent trait Pj which
451
+ * is the same as LambdaXYZ except that it has `I` in i-th position.
447
452
*/
448
453
def lambdaTrait (vcs : List [Int ]): ClassSymbol = {
449
454
assert(vcs.nonEmpty)
Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ class TyperState(r: Reporter) extends DotClass with Showable {
23
23
/** The uninstantiated variables */
24
24
def uninstVars = constraint.uninstVars
25
25
26
- /** The ephemeral flag */
26
+ /** The ephemeral flag is set as a side effect if an operation accesses
27
+ * the underlying type of a type variable. The reason we need this flag is
28
+ * that any such operation is not referentially transparent; it might logically change
29
+ * its value at the moment the type variable is instantiated. Caching code needs to
30
+ * check the ephemeral flag; If the flag is set during an operation, the result
31
+ * of that operation should not be cached.
32
+ */
27
33
def ephemeral : Boolean = false
28
34
def ephemeral_= (x : Boolean ): Unit = ()
29
35
Original file line number Diff line number Diff line change @@ -654,7 +654,8 @@ object Types {
654
654
*
655
655
* P { ... type T = / += / -= U ... } # T
656
656
*
657
- * to just U
657
+ * to just U. Does not perform the reduction if the resulting type would contain
658
+ * a reference to the "this" of the current refined type.
658
659
*/
659
660
def lookupRefined (name : Name )(implicit ctx : Context ): Type = stripTypeVar match {
660
661
case pre : RefinedType =>
You can’t perform that action at this time.
0 commit comments