syntax: Do not inherit signatures with closures
authorJean Privat <jean@pryen.org>
Tue, 24 Mar 2009 14:23:04 +0000 (10:23 -0400)
committerJean Privat <jean@pryen.org>
Wed, 10 Jun 2009 13:35:54 +0000 (09:35 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/syntax/mmbuilder.nit

index ccdd2a6..3a10b5a 100644 (file)
@@ -851,6 +851,10 @@ redef class PPropdef
                                        v.error(self, "Redef error: {prop.local_class}::{prop} redefines {ip.local_class}::{ip} with {isig.arity} parameter(s).")
                                        return
                                end
+                               if v.signature_builder.closure_decls.length != isig.closures.length then
+                                       v.error(self, "Redef error: {prop.local_class}::{prop} redefines {ip.local_class}::{ip} with {isig.arity} closure(s).")
+                                       return
+                               end
                                for p in v.signature_builder.params do
                                        var t = isig[p.position]
                                        p.stype = t