swc/crates/swc_ecma_parser/tests/tsc/classAbstractGeneric.ts

25 lines
505 B
TypeScript

abstract class A<T> {
t: T;
abstract foo(): T;
abstract bar(t: T);
}
abstract class B<T> extends A<T> {}
class C<T> extends A<T> {} // error -- inherits abstract methods
class D extends A<number> {} // error -- inherits abstract methods
class E<T> extends A<T> { // error -- doesn't implement bar
foo() { return this.t; }
}
class F<T> extends A<T> { // error -- doesn't implement foo
bar(t : T) {}
}
class G<T> extends A<T> {
foo() { return this.t; }
bar(t: T) { }
}