Skip to content
Permalink
Browse files
fix(49993): skip the quick fix for an expression with an enum type (#…
  • Loading branch information
a-tarasyuk committed Sep 21, 2022
1 parent 2644f28 commit 7a3de819bfb93fb27ef7ea8305d2df069866c380
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -257,7 +257,7 @@ namespace ts.codefix {
}

const enumDeclaration = find(symbol.declarations, isEnumDeclaration);
if (enumDeclaration && !isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
if (enumDeclaration && !(leftExpressionType.flags & TypeFlags.EnumLike) && !isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
return { kind: InfoKind.Enum, token, parentDeclaration: enumDeclaration };
}

@@ -0,0 +1,7 @@
/// <reference path="fourslash.ts" />

////enum E { A, B }
////declare var a: E;
////a.C;

verify.not.codeFixAvailable("fixMissingMember");

0 comments on commit 7a3de81

Please sign in to comment.