Merge pull request #6628 from Microsoft/thisTypeAsConstraint

break on 'this' type in hasConstraintReferenceTo
This commit is contained in:
Vladimir Matveev
2016-01-26 14:58:35 -08:00
parent 05803f5285
commit ef615bc0b6
5 changed files with 37 additions and 1 deletions

View File

@@ -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;
}