Skip to content

Commit

Permalink
Add documentation about caching
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jun 9, 2021
1 parent 2804eec commit a6d96ef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/init/Semantic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Semantic {
* V ⊑ R if V ∈ R
*
*/
sealed abstract class Value extends Cloneable {
sealed abstract class Value {
def show: String = this.toString()
}

Expand Down Expand Up @@ -142,7 +142,14 @@ class Semantic {

/** The environment for method parameters
*
* For performance and usability, we restrict parameters to be either `Cold` or `Hot`.
* For performance and usability, we restrict parameters to be either `Cold`
* or `Hot`.
*
* Despite that we have environment for evaluating expressions in secondary
* constructors (currently we restrict method arguments to be hot), we don't
* need to put environment as the cache key. The reason is that constructor
* parameters are determined by the value of `this` --- it suffices to make
* the value of `this` as part of the cache key.
*/
object Env {
opaque type Env = Map[Symbol, Value]
Expand Down

0 comments on commit a6d96ef

Please sign in to comment.