File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -19292,7 +19292,7 @@ namespace ts {
19292
19292
else {
19293
19293
// conditionals aren't related to one another via distributive constraint as it is much too inaccurate and allows way
19294
19294
// more assignments than are desirable (since it maps the source check type to its constraint, it loses information)
19295
- const distributiveConstraint = getConstraintOfDistributiveConditionalType(source as ConditionalType);
19295
+ const distributiveConstraint = hasNonCircularBaseConstraint(source) ? getConstraintOfDistributiveConditionalType(source as ConditionalType) : undefined ;
19296
19296
if (distributiveConstraint) {
19297
19297
if (result = isRelatedTo(distributiveConstraint, target, RecursionFlags.Source, reportErrors)) {
19298
19298
resetErrorInfo(saveErrorInfo);
@@ -19920,7 +19920,8 @@ namespace ts {
19920
19920
const incompatibleReporter = kind === SignatureKind.Construct ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
19921
19921
const sourceObjectFlags = getObjectFlags(source);
19922
19922
const targetObjectFlags = getObjectFlags(target);
19923
- if (sourceObjectFlags & ObjectFlags.Instantiated && targetObjectFlags & ObjectFlags.Instantiated && source.symbol === target.symbol) {
19923
+ if (sourceObjectFlags & ObjectFlags.Instantiated && targetObjectFlags & ObjectFlags.Instantiated && source.symbol === target.symbol ||
19924
+ sourceObjectFlags & ObjectFlags.Reference && targetObjectFlags & ObjectFlags.Reference && (source as TypeReference).target === (target as TypeReference).target) {
19924
19925
// We have instantiations of the same anonymous type (which typically will be the type of a
19925
19926
// method). Simply do a pairwise comparison of the signatures in the two signature lists instead
19926
19927
// of the much more expensive N * M comparison matrix we explore below. We erase type parameters
You can’t perform that action at this time.
0 commit comments