TypeScript/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.types

37 lines
524 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.ts ===
// no errors expected when instantiating a generic type with no type arguments provided
class C<T> {
>C : C<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
}
var c = new C();
>c : C<{}>
2014-08-15 23:33:16 +02:00
>new C() : C<{}>
>C : typeof C
2014-08-15 23:33:16 +02:00
class D<T, U> {
>D : D<T, U>
>T : T
>U : U
2014-08-15 23:33:16 +02:00
x: T
>x : T
>T : T
2014-08-15 23:33:16 +02:00
y: U
>y : U
>U : U
2014-08-15 23:33:16 +02:00
}
var d = new D();
>d : D<{}, {}>
2014-08-15 23:33:16 +02:00
>new D() : D<{}, {}>
>D : typeof D
2014-08-15 23:33:16 +02:00