Merge pull request #25500 from mattmccutchen/issue-25498

Fix crash in elaborateElementwise when the target property is known but it doesn't have a declaration (e.g., in a mapped type).
This commit is contained in:
Mohamed Hegazy
2018-07-09 15:35:35 -07:00
committed by GitHub
6 changed files with 53 additions and 3 deletions

View File

@@ -10367,9 +10367,9 @@ namespace ts {
}
}
if (!issuedElaboration && (length(targetProp && targetProp.declarations) || length(target.symbol && target.symbol.declarations))) {
if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) {
addRelatedInfo(reportedDiag, createDiagnosticForNode(
targetProp ? targetProp.declarations[0] : target.symbol.declarations[0],
targetProp && length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0],
Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,
propertyName && !(nameType.flags & TypeFlags.UniqueESSymbol) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType),
typeToString(target)