mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
40 lines
1.7 KiB
Plaintext
40 lines
1.7 KiB
Plaintext
classAbstractGeneric.ts(10,7): error TS2654: Non-abstract class 'C<T>' is missing implementations for the following members of 'A<T>': 'foo', 'bar'.
|
|
classAbstractGeneric.ts(12,7): error TS2654: Non-abstract class 'D' is missing implementations for the following members of 'A<number>': 'foo', 'bar'.
|
|
classAbstractGeneric.ts(14,7): error TS2515: Non-abstract class 'E<T>' does not implement inherited abstract member bar from class 'A<T>'.
|
|
classAbstractGeneric.ts(18,7): error TS2515: Non-abstract class 'F<T>' does not implement inherited abstract member foo from class 'A<T>'.
|
|
|
|
|
|
==== classAbstractGeneric.ts (4 errors) ====
|
|
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
|
|
~
|
|
!!! error TS2654: Non-abstract class 'C<T>' is missing implementations for the following members of 'A<T>': 'foo', 'bar'.
|
|
|
|
class D extends A<number> {} // error -- inherits abstract methods
|
|
~
|
|
!!! error TS2654: Non-abstract class 'D' is missing implementations for the following members of 'A<number>': 'foo', 'bar'.
|
|
|
|
class E<T> extends A<T> { // error -- doesn't implement bar
|
|
~
|
|
!!! error TS2515: Non-abstract class 'E<T>' does not implement inherited abstract member bar from class 'A<T>'.
|
|
foo() { return this.t; }
|
|
}
|
|
|
|
class F<T> extends A<T> { // error -- doesn't implement foo
|
|
~
|
|
!!! error TS2515: Non-abstract class 'F<T>' does not implement inherited abstract member foo from class 'A<T>'.
|
|
bar(t : T) {}
|
|
}
|
|
|
|
class G<T> extends A<T> {
|
|
foo() { return this.t; }
|
|
bar(t: T) { }
|
|
} |