Merge: Simplify constructors: next episode
authorJean Privat <jean@pryen.org>
Tue, 28 Jan 2020 20:03:47 +0000 (15:03 -0500)
committerJean Privat <jean@pryen.org>
Tue, 28 Jan 2020 20:03:47 +0000 (15:03 -0500)
The current constructors are quite complex, that is why Jean Privat had proposed to simplify them with the pr #1966.

The current init has a double facet, internal with a signature and an empty body and an external one with a signature and initializer represent the attributes to initialize.

This pr replace the external facet by introducing a new constructor defaultinit specific to each class. This default property includes the orchestration of initializers (non-default attributes, autoinit methods, and autoinit annotation in the class). In addition, this property is now the one exposed when a new A is executed.

The current init used to manually set the default constructor it's used to perform a processing after initialization. Note this one must have an empty signature. If this is not the case, an error will be generated.

To use the init in a similar way, we now have to use the old_style_init annotation.

This pr resolve minor bugs and test issues of the Jean's pr .

Pull-Request: #2803
Reviewed-by: Jean Privat <jean@pryen.org>

1  2 
src/compiler/abstract_compiler.nit
src/rapid_type_analysis.nit

Simple merge
Simple merge