modelize: error in `autoinit` is used in class refinement
authorJean Privat <jean@pryen.org>
Fri, 29 May 2015 16:05:42 +0000 (12:05 -0400)
committerJean Privat <jean@pryen.org>
Tue, 9 Jun 2015 00:44:16 +0000 (20:44 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/modelize/modelize_property.nit

index a5a8ef9..4633b3f 100644 (file)
@@ -988,6 +988,8 @@ redef class AMethPropdef
                if atautoinit != null then
                        if not mpropdef.is_intro then
                                modelbuilder.error(atautoinit, "Error: `autoinit` cannot be set on redefinitions.")
+                       else if not mclassdef.is_intro then
+                               modelbuilder.error(atautoinit, "Error: `autoinit` cannot be used in class refinements.")
                        else
                                self.is_autoinit = true
                        end