Signed-off-by: Jean Privat <jean@pryen.org>
if callsite == null then return
if not callsite.mproperty.is_new then
- if recvtype.mclass.kind == abstract_kind then
- v.error(self, "Cannot instantiate abstract class {recvtype}.")
- return
- else if recvtype.mclass.kind == interface_kind then
- v.error(self, "Cannot instantiate interface {recvtype}.")
+ var kind = recvtype.mclass.kind
+ if kind != concrete_kind then
+ v.error(self, "Cannot instantiate {kind} {recvtype}.")
return
end
self.mtype = recvtype