compiler: implements method_finish (partially)
authorJean Privat <jean@pryen.org>
Thu, 9 Oct 2014 00:21:07 +0000 (20:21 -0400)
committerJean Privat <jean@pryen.org>
Thu, 9 Oct 2014 00:21:07 +0000 (20:21 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit
src/rapid_type_analysis.nit

index c98d54e..a6f6afa 100644 (file)
@@ -2601,6 +2601,12 @@ redef class AForExpr
                v.compile_callsite(next_meth, [it])
                v.add("\}")
                v.add("BREAK_{v.escapemark_name(escapemark)}: (void)0;")
+
+               var method_finish = self.method_finish
+               if method_finish != null then
+                       # TODO: Find a way to call this also in long escape (e.g. return)
+                       v.compile_callsite(method_finish, [it])
+               end
        end
 end
 
index a6adfee..6ce94cb 100644 (file)
@@ -675,6 +675,8 @@ redef class AForExpr
                        abort
                end
                v.add_callsite(self.method_next)
+               var mf = self.method_finish
+               if mf != null then v.add_callsite(mf)
        end
 end