Skip to content

Commit e5e91f1

Browse files
author
Sebastian Nadorp
committed
Revert "Only expand the tree if no errors are reported."
This reverts commit 0b0e616.
1 parent 0b0e616 commit e5e91f1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ object DesugarEnums {
6464
}
6565

6666
/** A type tree referring to `enumClass` */
67-
def enumClassRef(implicit ctx: Context) = TypeTree(enumClass.typeRef)
67+
def enumClassRef(implicit ctx: Context) =
68+
if (enumClass.exists) TypeTree(enumClass.typeRef) else TypeTree()
6869

6970
/** Add implied flags to an enum class or an enum case */
7071
def addEnumFlags(cdef: TypeDef)(implicit ctx: Context) =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class Namer { typer: Typer =>
415415

416416
/** Expand tree and store in `expandedTree` */
417417
def expand(tree: Tree)(implicit ctx: Context): Unit = tree match {
418-
case mdef: DefTree if !ctx.reporter.hasErrors =>
418+
case mdef: DefTree =>
419419
val expanded = desugar.defTree(mdef)
420420
typr.println(i"Expansion: $mdef expands to $expanded")
421421
if (expanded ne mdef) mdef.pushAttachment(ExpandedTree, expanded)

0 commit comments

Comments
 (0)