diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 957a51532886..f70bf20a9ec6 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1765,8 +1765,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer untpd.ValDef( EvidenceParamName.fresh(), untpd.TypeTree(defn.CanThrowClass.typeRef.appliedTo(tp)), - untpd.ref(defn.Predef_undefined)) - .withFlags(Given | Final | Lazy | Erased) + untpd.ref(defn.Compiletime_erasedValue)) + .withFlags(Given | Final | Erased) .withSpan(expr.span) val caughtExceptions = if Feature.enabled(Feature.saferExceptions) then