mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Merge pull request #6628 from Microsoft/thisTypeAsConstraint
break on 'this' type in hasConstraintReferenceTo
This commit is contained in:
@@ -4285,7 +4285,7 @@ namespace ts {
|
||||
|
||||
function hasConstraintReferenceTo(type: Type, target: TypeParameter): boolean {
|
||||
let checked: Type[];
|
||||
while (type && type.flags & TypeFlags.TypeParameter && !contains(checked, type)) {
|
||||
while (type && !(type.flags & TypeFlags.ThisType) && type.flags & TypeFlags.TypeParameter && !contains(checked, type)) {
|
||||
if (type === target) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user