Merge pull request #31093 from andrewbranch/bug/30997

Fix crash getting error for type alias index signature without a type
This commit is contained in:
Andrew Branch
2019-04-24 11:36:38 -07:00
committed by GitHub
6 changed files with 46 additions and 5 deletions

View File

@@ -31005,7 +31005,7 @@ namespace ts {
Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead,
getTextOfNode(parameter.name),
typeToString(type),
typeToString(getTypeFromTypeNode(node.type!)));
typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType));
}
if (type.flags & TypeFlags.Union && allTypesAssignableToKind(type, TypeFlags.StringLiteral, /*strict*/ true)) {