From 4bec99b0e5d23d9cd504e5c6ecb485f0bdae1567 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 8 Apr 2015 20:14:19 +0700 Subject: [PATCH] modelize_classes: top-level methods are defined in Sys, not Object Signed-off-by: Jean Privat --- src/modelize/modelize_class.nit | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modelize/modelize_class.nit b/src/modelize/modelize_class.nit index 3c54891..ae4e4c2 100644 --- a/src/modelize/modelize_class.nit +++ b/src/modelize/modelize_class.nit @@ -75,20 +75,21 @@ redef class ModelBuilder names.add(ptname) end - else if nclassdef isa ATopClassdef then + else if nclassdef isa ATopClassdef and nclassdef.n_propdefs.first.as(AMethPropdef).n_methid.collect_text == "sys" then + # Special case to keep `sys` in object. + # Needed to keep working bootstrap and a working java FFI together. + # TODO: remove once safe to remove name = "Object" nkind = null mkind = interface_kind nvisibility = null mvisibility = public_visibility - else if nclassdef isa AMainClassdef then + else name = "Sys" nkind = null mkind = concrete_kind nvisibility = null mvisibility = public_visibility - else - abort end var mclass = try_get_mclass_by_name(nclassdef, mmodule, name) -- 1.7.9.5