mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 20:37:46 -05:00
Get constraint with this argument of the type parameter for comparisons (#21210)
* Get constraint with this argument of the type parameter for comparisons * Also instantiate indexed accesses * Add much simpler test
This commit is contained in:
@@ -10954,9 +10954,12 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else if (result = isRelatedTo(constraint, target, reportErrors)) {
|
||||
errorInfo = saveErrorInfo;
|
||||
return result;
|
||||
else {
|
||||
const instantiated = getTypeWithThisArgument(constraint, source);
|
||||
if (result = isRelatedTo(instantiated, target, reportErrors)) {
|
||||
errorInfo = saveErrorInfo;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (source.flags & TypeFlags.Index) {
|
||||
|
||||
Reference in New Issue
Block a user