nitg-s: use the original type in type tests
authorJean Privat <jean@pryen.org>
Fri, 28 Feb 2014 13:59:03 +0000 (08:59 -0500)
committerJean Privat <jean@pryen.org>
Fri, 28 Feb 2014 17:31:25 +0000 (12:31 -0500)
RTA discovers original types, thus do not try to un-nullify some.

Signed-off-by: Jean Privat <jean@pryen.org>

src/separate_compiler.nit

index 15f9e03..54f45c8 100644 (file)
@@ -1349,13 +1349,13 @@ class SeparateCompilerVisitor
                        self.add_decl("const struct type* {type_struct};")
 
                        # Either with resolution_table with a direct resolution
-                       hardening_live_open_type(ntype)
-                       link_unresolved_type(self.frame.mpropdef.mclassdef, ntype)
-                       self.require_declaration(ntype.const_color)
+                       hardening_live_open_type(mtype)
+                       link_unresolved_type(self.frame.mpropdef.mclassdef, mtype)
+                       self.require_declaration(mtype.const_color)
                        if compiler.modelbuilder.toolcontext.opt_phmod_typing.value or compiler.modelbuilder.toolcontext.opt_phand_typing.value then
-                               self.add("{type_struct} = {recv_type_info}->resolution_table->types[HASH({recv_type_info}->resolution_table->mask, {ntype.const_color})];")
+                               self.add("{type_struct} = {recv_type_info}->resolution_table->types[HASH({recv_type_info}->resolution_table->mask, {mtype.const_color})];")
                        else
-                               self.add("{type_struct} = {recv_type_info}->resolution_table->types[{ntype.const_color}];")
+                               self.add("{type_struct} = {recv_type_info}->resolution_table->types[{mtype.const_color}];")
                        end
                        if compiler.modelbuilder.toolcontext.opt_typing_test_metrics.value then
                                self.compiler.count_type_test_unresolved[tag] += 1