【发布时间】:2015-07-07 10:38:56
【问题描述】:
为什么编译器不抱怨下面的代码?该接口有一种方法是无效的。该类实现了接口但签名不一样,但编译器仍然没有抱怨;
interface myinterface {
getMethod() : void;
}
class myclass implements myinterface {
getMethod() {
return "return string";
}
}
var myObj = new myclass()
var strVar = myObj.getMethod();
【问题讨论】:
标签: typescript