Skip to content

Commit 2560f15

Browse files
committed
Try early promotion before updating env
1 parent c886d5a commit 2560f15

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

compiler/src/dotty/tools/dotc/config/Config.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ object Config {
192192
inline val flattenContextFunctionResults = true
193193

194194
/** If set, enables tracing */
195-
inline val tracingEnabled = true
195+
inline val tracingEnabled = false
196196

197197
/** Initial capacity of the uniques HashMap.
198198
* Note: This should be a power of two to work with util.HashSet

compiler/src/dotty/tools/dotc/config/Printers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Printers {
2828
val implicits = noPrinter
2929
val implicitsDetailed = noPrinter
3030
val lexical = noPrinter
31-
val init = new Printer
31+
val init = noPrinter
3232
val inlining = noPrinter
3333
val interactiv = noPrinter
3434
val matchTypes = noPrinter

compiler/src/dotty/tools/dotc/reporting/trace.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ trait TraceSyntax:
9090
finalize(trailing(ex.value))
9191
throw ex
9292
case ex: Throwable =>
93-
// val msg = s"<== $q = <missing> (with exception $ex)"
94-
// finalize(msg)
93+
val msg = s"<== $q = <missing> (with exception $ex)"
94+
finalize(msg)
9595
throw ex
9696
end TraceSyntax

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,8 @@ class Semantic {
690690
case h :: t => h match {
691691
case v: ValDef => {
692692
val res = eval(h, thisV, klass)
693-
val newEnv = Env(Map(v.symbol -> res.value))
693+
val newEnv =
694+
if res.value.promote("Try early promotion", h).isEmpty then Env(Map(v.symbol -> Hot)) else Env(Map(v.symbol -> res.value))
694695
withEnv(env.union(newEnv)) {
695696
val (res2, env2) = eval(t, thisV, klass)
696697
(res :: res2, env2)

0 commit comments

Comments
 (0)