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

@@ -0,0 +1,14 @@
//// [thisTypeAsConstraint.ts]
class C {
public m<T extends this>() {
}
}
//// [thisTypeAsConstraint.js]
var C = (function () {
function C() {
}
C.prototype.m = function () {
};
return C;
}());

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/thisTypeAsConstraint.ts ===
class C {
>C : Symbol(C, Decl(thisTypeAsConstraint.ts, 0, 0))
public m<T extends this>() {
>m : Symbol(m, Decl(thisTypeAsConstraint.ts, 0, 9))
>T : Symbol(T, Decl(thisTypeAsConstraint.ts, 1, 11))
}
}

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/thisTypeAsConstraint.ts ===
class C {
>C : C
public m<T extends this>() {
>m : <T extends this>() => void
>T : T
}
}

View File

@@ -0,0 +1,4 @@
class C {
public m<T extends this>() {
}
}