Merge pull request #6628 from Microsoft/thisTypeAsConstraint

break on 'this' type in hasConstraintReferenceTo
This commit is contained in:
Vladimir Matveev committed 2016-01-26 21:39:47 -08:00
1 parent 05803f5285
commit ef615bc0b6
5 files changed
+37 -1

No files matched your search

+1 -1
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;
}