mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
do not handle enum type member
This commit is contained in:
1 parent
d6f5fc6518
commit
d8cdd7552e
4 files changed
+4
-5
No files matched your search
@@ -240,7 +240,7 @@ namespace ts.codefix {
|
||||
*/
|
||||
const hasStringInitializer = some(enumDeclaration.members, member => {
|
||||
const type = checker.getTypeAtLocation(member);
|
||||
return !!(type && type.flags & (TypeFlags.StringLike | TypeFlags.Enum));
|
||||
return !!(type && type.flags & TypeFlags.StringLike);
|
||||
});
|
||||
|
||||
const enumMember = createEnumMember(token, hasStringInitializer ? createStringLiteral(token.text) : undefined);
|
||||
|
||||
@@ -19,7 +19,7 @@ verify.codeFix({
|
||||
}
|
||||
enum A {
|
||||
a = E.c,
|
||||
b = "b"
|
||||
b
|
||||
}
|
||||
A.b`
|
||||
});
|
||||
@@ -25,8 +25,7 @@ enum A {
|
||||
}
|
||||
enum B {
|
||||
b = A.a,
|
||||
c = "c"
|
||||
c
|
||||
}
|
||||
B.c`
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ verify.codeFix({
|
||||
}
|
||||
enum A {
|
||||
a = E.a,
|
||||
b = "b"
|
||||
b
|
||||
}
|
||||
A.b`
|
||||
});
|
||||
Reference in new issue
Block a user