model: mpropdef2node falls back to the class node
authorJean Privat <jean@pryen.org>
Fri, 26 Feb 2016 15:01:55 +0000 (10:01 -0500)
committerJean Privat <jean@pryen.org>
Fri, 26 Feb 2016 15:01:55 +0000 (10:01 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/modelize/modelize_property.nit

index 03d9951..f2f791a 100644 (file)
@@ -55,10 +55,9 @@ redef class ModelBuilder
                        toolcontext.run_phases_on_npropdef(res)
                        return res
                end
-               if mpropdef isa MMethodDef and mpropdef.mproperty.is_root_init then
-                       res = mclassdef2nclassdef.get_or_null(mpropdef.mclassdef)
-                       if res != null then return res
-               end
+               # Fall back to the class node if any.
+               res = mclassdef2nclassdef.get_or_null(mpropdef.mclassdef)
+               if res != null then return res
                return null
        end