mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
17 lines
249 B
TypeScript
17 lines
249 B
TypeScript
abstract class A {
|
|
abstract foo() : number;
|
|
}
|
|
|
|
class B extends A {
|
|
foo() { return 1; }
|
|
}
|
|
|
|
abstract class C extends A {
|
|
abstract foo() : number;
|
|
}
|
|
|
|
var a = new B;
|
|
a.foo();
|
|
|
|
a = new C; // error, cannot instantiate abstract class.
|
|
a.foo(); |