exceptions are pimitive types and classes that have a `new` factory
Signed-off-by: Jean Privat <jean@pryen.org>
method_tables = new HashMap[MClass, Array[nullable MPropDef]]
attr_tables = new HashMap[MClass, Array[nullable MProperty]]
for mclass in mclasses do
- #if mclass.kind == abstract_kind or mclass.kind == interface_kind then continue
+ if not mclass.has_new_factory and (mclass.kind == abstract_kind or mclass.kind == interface_kind) then continue
if rta != null and not rta.live_classes.has(mclass) then continue
var mtype = mclass.intro.bound_mtype
end
private var get_mtype_cache = new HashMap[Array[MType], MGenericType]
+
+ # Is there a `new` factory to allow the pseudo instantiation?
+ var has_new_factory = false is writable
end
end
mprop.is_init = is_init
mprop.is_new = n_kwnew != null
+ if mprop.is_new then mclassdef.mclass.has_new_factory = true
if parent isa ATopClassdef then mprop.is_toplevel = true
self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, mprop)
else