mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 23:27:56 +03:00
25 lines
505 B
TypeScript
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) { }
|
|
} |