Address PR comments

This commit is contained in:
Nathan Shively-Sanders 2017-02-13 13:35:07 -08:00
parent 11929e33ed
commit 271ca80c75

View File

@ -7777,8 +7777,10 @@ namespace ts {
return related;
}
}
const discriminantType = findMatchingDiscriminantType(source, target);
isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], reportErrors);
if (reportErrors) {
const discriminantType = findMatchingDiscriminantType(source, target);
isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true);
}
return Ternary.False;
}