Skip to content

Commit 8af5910

Browse files
committed
Only report used before declaration errors on regular enums
const enums don't generate code and the values are inlined so now error is necessary
1 parent 50e2912 commit 8af5910

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ namespace ts {
12801280
else if (result.flags & SymbolFlags.Class) {
12811281
error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationNameToString(getNameOfDeclaration(declaration)));
12821282
}
1283-
else if (result.flags & SymbolFlags.Enum) {
1283+
else if (result.flags & SymbolFlags.RegularEnum) {
12841284
error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationNameToString(getNameOfDeclaration(declaration)));
12851285
}
12861286
}

0 commit comments

Comments
 (0)