File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class Semantic {
5555 * V ⊑ R if V ∈ R
5656 *
5757 */
58- sealed abstract class Value extends Cloneable {
58+ sealed abstract class Value {
5959 def show : String = this .toString()
6060 }
6161
@@ -142,7 +142,14 @@ class Semantic {
142142
143143 /** The environment for method parameters
144144 *
145- * For performance and usability, we restrict parameters to be either `Cold` or `Hot`.
145+ * For performance and usability, we restrict parameters to be either `Cold`
146+ * or `Hot`.
147+ *
148+ * Despite that we have environment for evaluating expressions in secondary
149+ * constructors (currently we restrict method arguments to be hot), we don't
150+ * need to put environment as the cache key. The reason is that constructor
151+ * parameters are determined by the value of `this` --- it suffices to make
152+ * the value of `this` as part of the cache key.
146153 */
147154 object Env {
148155 opaque type Env = Map [Symbol , Value ]
You can’t perform that action at this time.
0 commit comments