mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Fixed an incorrect assumption K in Union works with numeric literals
This commit is contained in:
1 parent
92bffe43c5
commit
8755d4da47
6 files changed
+14
-59
No files matched your search
@@ -25781,7 +25781,7 @@ namespace ts {
|
||||
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Use_index_Colon_0_instead, typeToString(type));
|
||||
}
|
||||
|
||||
if (type.flags & TypeFlags.Union && every((<UnionType>type).types, t => !!(t.flags & TypeFlags.StringOrNumberLiteral))) {
|
||||
if (type.flags & TypeFlags.Union && every((<UnionType>type).types, t => !!(t.flags & TypeFlags.StringLiteral))) {
|
||||
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Use_K_in_0_instead, symbolName(type.aliasSymbol));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user