Skip to content

Commit 8da6ba7

Browse files
committed
Homogenize generation of erased definitions
The erased value generated by a `try` is now a reference to `erasedValue` like other generated erased expressions. We also remove the `Lazy` as it is semantically meaningless in an erased definition.
1 parent c01d596 commit 8da6ba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
17651765
untpd.ValDef(
17661766
EvidenceParamName.fresh(),
17671767
untpd.TypeTree(defn.CanThrowClass.typeRef.appliedTo(tp)),
1768-
untpd.ref(defn.Predef_undefined))
1769-
.withFlags(Given | Final | Lazy | Erased)
1768+
untpd.ref(defn.Compiletime_erasedValue))
1769+
.withFlags(Given | Final | Erased)
17701770
.withSpan(expr.span)
17711771
val caughtExceptions =
17721772
if Feature.enabled(Feature.saferExceptions) then

0 commit comments

Comments
 (0)