TypeScript/tests/cases/compiler/superWithGenericSpecialization.ts

14 lines
247 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
class C<T> {
x: T;
}
class D<T> extends C<string> {
y: T;
constructor() {
super(); // uses the type parameter type of the base class, ie string
}
}
var d: D<number>;
var r: string = d.x;
var r2: number = d.y;