typing: add AForExpr::method_finish
authorJean Privat <jean@pryen.org>
Thu, 9 Oct 2014 00:17:25 +0000 (20:17 -0400)
committerJean Privat <jean@pryen.org>
Thu, 9 Oct 2014 00:17:25 +0000 (20:17 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/semantize/typing.nit

index 715878a..cf84e4c 100644 (file)
@@ -855,6 +855,7 @@ redef class AForExpr
        var method_item: nullable CallSite
        var method_next: nullable CallSite
        var method_key: nullable CallSite
+       var method_finish: nullable CallSite
 
        private fun do_type_iterator(v: TypeVisitor, mtype: MType)
        do
@@ -946,6 +947,8 @@ redef class AForExpr
                end
                self.method_next = nextdef
 
+               self.method_finish = v.try_get_method(self, ittype, "finish", false)
+
                if is_map then
                        var keydef = v.get_method(self, ittype, "key", false)
                        if keydef == null then