TypeScript/tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts
Anders Hejlsberg 870e96e525 Adding test
2015-11-06 08:55:08 -08:00

22 lines
317 B
TypeScript

class A {
self() {
return this;
}
}
function f<T extends A>(x: T) {
function g<U extends T>(x: U) {
x = x.self();
}
x = x.self();
}
class B<T extends A> {
foo(x: T) {
x = x.self();
}
bar<U extends T>(x: U) {
x = x.self();
}
}