Fix crash getting error for type alias index signature without a type

This commit is contained in:
Andrew Branch
2019-04-24 10:35:23 -07:00
parent 6608349ea2
commit 956436853e
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)) {