因为abstract
函数不能具有函数,bodies
并且默认参数是只有在具有函数主体的情况下才能实现的东西。
允许:
abstract class Atom { abstract foo(x:any); }
错误:
abstract class Atom { abstract foo(x:any=null); // Cannot have an implementation }
错误:
abstract class Atom { abstract foo(x:any){ // Error cannot have implementation } }
允许:
abstract class Atom { abstract foo(x?:any); }