rta: store real types in live_cast_type
[nit.git] / src / abstract_compiler.nit
index 6a4923b..76aaa19 100644 (file)
@@ -107,8 +107,14 @@ redef class ModelBuilder
                        cc_paths.append(path_env.split_with(':'))
                end
 
+               var compile_dir = toolcontext.opt_compile_dir.value
+               if compile_dir == null then compile_dir = ".nit_compile"
+               self.compile_dir = compile_dir
        end
 
+       # The compilation directory
+       var compile_dir: String
+
        protected fun write_and_make(compiler: AbstractCompiler)
        do
                var mainmodule = compiler.mainmodule
@@ -119,9 +125,6 @@ redef class ModelBuilder
                var time0 = get_time
                self.toolcontext.info("*** WRITING C ***", 1)
 
-               var compile_dir = toolcontext.opt_compile_dir.value
-               if compile_dir == null then compile_dir = ".nit_compile"
-
                compile_dir.mkdir
 
                if self.toolcontext.opt_stacktrace.value then compiler.build_c_to_nit_bindings
@@ -349,8 +352,7 @@ abstract class AbstractCompiler
        # Binds the generated C function names to Nit function names
        fun build_c_to_nit_bindings
        do
-               var compile_dir = modelbuilder.toolcontext.opt_compile_dir.value
-               if compile_dir == null then compile_dir = ".nit_compile"
+               var compile_dir = modelbuilder.compile_dir
 
                var stream = new OFStream.open("{compile_dir}/C_fun_names")
                stream.write("%\{\n#include \"c_functions_hash.h\"\n%\}\n")
@@ -2400,13 +2402,13 @@ redef class ASuperExpr
                        args = v.frame.arguments
                end
 
-               var mproperty = self.mproperty
-               if mproperty != null then
-                       if mproperty.intro.msignature.arity == 0 then
+               var callsite = self.callsite
+               if callsite != null then
+                       if callsite.mproperty.intro.msignature.arity == 0 then
                                args = [recv]
                        end
                        # Super init call
-                       var res = v.send(mproperty, args)
+                       var res = v.compile_callsite(callsite, args)
                        return res
                end