mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
31 lines
568 B
TypeScript
31 lines
568 B
TypeScript
interface ContextualType<T> {
|
|
method(parameter: T): void;
|
|
}
|
|
|
|
class CBase<T> {
|
|
constructor(param: ContextualType<T>) {
|
|
}
|
|
|
|
foo(param: ContextualType<T>) {
|
|
}
|
|
}
|
|
|
|
class C extends CBase<string> {
|
|
constructor() {
|
|
// Should be okay.
|
|
// 'p' should have type 'string'.
|
|
super({
|
|
method(p) {
|
|
p.length;
|
|
}
|
|
});
|
|
|
|
// Should be okay.
|
|
// 'p' should have type 'string'.
|
|
super.foo({
|
|
method(p) {
|
|
p.length;
|
|
}
|
|
});
|
|
}
|
|
} |