Merge: modelize: ask that attributes in refinements are either noautoninit or have...
authorJean Privat <jean@pryen.org>
Sat, 30 May 2015 00:37:16 +0000 (20:37 -0400)
committerJean Privat <jean@pryen.org>
Sat, 30 May 2015 00:37:16 +0000 (20:37 -0400)
commit41dcf7cba06d86e77a48a810f1b765699638add5
treeb6f9cb4177da632b62cf1678a701e1fc40da4fac
parentbe87b9f94923d58a4727fd208291f3df298548fe
parent8fffa5ae943a4e9624186b923958e403d76ef866
Merge: modelize: ask that attributes in refinements are either noautoninit or have a value

Without value, attributes in introductions does not have the same semantic that attributes in refinements

In introduction attributes are implicitly `autoinit`, in refinements they are `noautoinit`.

This is not POLA since

* this confuse beginners
* readers have to remember if they are in an intro or a refinement
* aditionnal cognitive fragility in constructors (more cases and rules to take in account)

This PR make `autoinit` the default and ask that attributes declared in refinement are either annotated `noautoinit` or have a default value.
This way, the writer has to think about the implication of adding a new attributes in existing classes, especially to think about their initialization. Thus this could help the programmer to avoid bad error.

For the moment, I just display a warning because I want to wait for feedback before doing a big migration (or doing nothing if people hate that), I also want to use jenkins to count and locate these new warnings.

Related to #1322

Pull-Request: #1411
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/standard/string.nit
src/modelize/modelize_property.nit