Don't widen unique symbol types during type inference
This commit is contained in:
parent
16cd5580a6
commit
b11be80349
1 changed files with 1 additions and 2 deletions
|
@ -12372,14 +12372,13 @@ namespace ts {
|
|||
inferredType = getTypeFromInference(inference);
|
||||
}
|
||||
|
||||
inferredType = getWidenedUniqueESSymbolType(inferredType);
|
||||
inference.inferredType = inferredType;
|
||||
|
||||
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
||||
if (constraint) {
|
||||
const instantiatedConstraint = instantiateType(constraint, context);
|
||||
if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
||||
inference.inferredType = inferredType = getWidenedUniqueESSymbolType(instantiatedConstraint);
|
||||
inference.inferredType = inferredType = instantiatedConstraint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue