TypeScript/tests/baselines/reference/typeOfThisInMemberFunctions.types

72 lines
900 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/typeOfThisInMemberFunctions.ts ===
class C {
>C : C
2014-08-15 23:33:16 +02:00
foo() {
>foo : () => void
2014-08-15 23:33:16 +02:00
var r = this;
>r : C
>this : C
2014-08-15 23:33:16 +02:00
}
static bar() {
>bar : () => void
2014-08-15 23:33:16 +02:00
var r2 = this;
>r2 : typeof C
>this : typeof C
2014-08-15 23:33:16 +02:00
}
}
class D<T> {
>D : D<T>
>T : T
2014-08-15 23:33:16 +02:00
x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
foo() {
>foo : () => void
2014-08-15 23:33:16 +02:00
var r = this;
>r : D<T>
>this : D<T>
2014-08-15 23:33:16 +02:00
}
static bar() {
>bar : () => void
2014-08-15 23:33:16 +02:00
var r2 = this;
>r2 : typeof D
>this : typeof D
2014-08-15 23:33:16 +02:00
}
}
class E<T extends Date> {
>E : E<T>
>T : T
>Date : Date
2014-08-15 23:33:16 +02:00
x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
foo() {
>foo : () => void
2014-08-15 23:33:16 +02:00
var r = this;
>r : E<T>
>this : E<T>
2014-08-15 23:33:16 +02:00
}
static bar() {
>bar : () => void
2014-08-15 23:33:16 +02:00
var r2 = this;
>r2 : typeof E
>this : typeof E
2014-08-15 23:33:16 +02:00
}
}