Skip to content

Commit

Permalink
Address review: Add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed May 21, 2021
1 parent f67b3cd commit 12bfbd2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/init/Semantic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ class Semantic {
* │ │ │ │
* └─────────┴──────┴───────┘
* Hot
*
* The most important ordering is the following:
*
* Hot ⊑ Warm(C) ⊑ ThisRef(C) ⊑ Cold
*
* The diagram above does not reflect relationship between `RefSet`
* and other values. `RefSet` represents a set of values which could
* be `ThisRef`, `Warm` or `Fun`. The following ordering applies for
* RefSet:
*
* R_a ⊑ R_b if R_a ⊆ R_b
*
* V ⊑ R if V ∈ R
*
*/
sealed abstract class Value {
def show: String = this.toString()
Expand Down Expand Up @@ -288,6 +302,7 @@ class Semantic {
Result(value2, errors)
}

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

0 comments on commit 12bfbd2

Please sign in to comment.