Conform constructors to the strict 'redef' rule.
authorJean Privat <jean@pryen.org>
Sat, 27 Dec 2008 19:02:13 +0000 (14:02 -0500)
committerJean Privat <jean@pryen.org>
Sat, 27 Dec 2008 19:02:13 +0000 (14:02 -0500)
For some old reasons, 'redef' in front of a new constructor was ignored.
Now the standard behavior is the rule for constructors.

src/syntax/mmbuilder.nit

index 5b4c47a..8d52ce3 100644 (file)
@@ -635,7 +635,7 @@ redef class PPropdef
                        visibility_level = 3
                end
                glob.visibility_level = visibility_level
-               if has_redef and not glob.is_init then
+               if has_redef then
                        v.error(self, "Error: No property {prop.local_class}::{prop} is inherited. Remove the redef keyword to define a new property.")
                end
                if glob.is_attribute then
@@ -698,7 +698,7 @@ redef class PPropdef
                var is_init = self isa AConcreteInitPropdef
                var glob = prop.global
 
-               if not has_redef and prop.name != once "init".to_symbol then
+               if not has_redef then
                        v.error(self, "Redef error: {prop.local_class}::{prop} is an inherited property. To redefine it, add the redef keyword.")
                        return
                end