Skip to content

Commit 12bfbd2

Browse files
committed
Address review: Add more documentation
1 parent f67b3cd commit 12bfbd2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ class Semantic {
4040
* │ │ │ │
4141
* └─────────┴──────┴───────┘
4242
* Hot
43+
*
44+
* The most important ordering is the following:
45+
*
46+
* Hot ⊑ Warm(C) ⊑ ThisRef(C) ⊑ Cold
47+
*
48+
* The diagram above does not reflect relationship between `RefSet`
49+
* and other values. `RefSet` represents a set of values which could
50+
* be `ThisRef`, `Warm` or `Fun`. The following ordering applies for
51+
* RefSet:
52+
*
53+
* R_a ⊑ R_b if R_a ⊆ R_b
54+
*
55+
* V ⊑ R if V ∈ R
56+
*
4357
*/
4458
sealed abstract class Value {
4559
def show: String = this.toString()
@@ -288,6 +302,7 @@ class Semantic {
288302
Result(value2, errors)
289303
}
290304

305+
/** Handle a new expression `new p.C` where `p` is abstracted by `value` */
291306
def instantiate(klass: ClassSymbol, ctor: Symbol, source: Tree): Contextual[Result] =
292307
value match {
293308
case Hot =>

0 commit comments

Comments
 (0)