nitc/globalcomp: avoid looking at unexisting methods
authorJean Privat <jean@pryen.org>
Fri, 25 Mar 2016 02:31:45 +0000 (22:31 -0400)
committerJean Privat <jean@pryen.org>
Fri, 25 Mar 2016 02:52:52 +0000 (22:52 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/global_compiler.nit

index b0d5c27..0ac6e66 100644 (file)
@@ -448,6 +448,10 @@ class GlobalCompilerVisitor
                if args.first.mtype.is_c_primitive then
                        var mclasstype = args.first.mtype.as(MClassType)
                        if not self.compiler.runtime_type_analysis.live_types.has(mclasstype) then
+                               self.add("/* skip, dead class {mclasstype} */")
+                               return res
+                       end
+                       if not mclasstype.has_mproperty(self.compiler.mainmodule, m) then
                                self.add("/* skip, no method {m} */")
                                return res
                        end