mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
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;
|
|
}
|
|
});
|
|
}
|
|
} |