mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +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(); |