model: MGenericType::to_s add space between formal types

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
tests: add some tests for covariant genericity.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
tests: add some tests on virtual types.

tests use recursive vt declarations

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-e: better handling of virtual types.

VT are now colorized and stored in the class table to be retrieved à type test.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
niti: move base_isa_nullable2 to fixme

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s/nitg-e: handles nullable virtual type based on non-nullable virtual types.

class A
   type T: X
   type U: nullable T
end

U is now correctly considered as a nullable T.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge remote-tracking branch 'github-privat/master'

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg/nitg-s: move MParameterType::c_name and MNullableType::c_name from nitg to nitg-s

Both are only used from nitg-s and subclasses

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s/-e: move compiler.header initialisation into init

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s: rename SeparateCompiler:do_global_type_coloring to do_type_coloring

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s/-e: refactor property coloring for use of #define

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s: add --inline-coloring-numbers option

With this option activated nitg-s use #define to inline coloring numbers.
Without, nitg-s use const.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg: fix tests/sav/nitg with new options added in nitg-s

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-e: change empty slots representation in vt tables to avoid C warning in sparse tables.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg-s/-e: Add option --use-naive-coloring

When enabled, this option replace standard coloring by a naive one allowing the compiler to simulate binary matrix type representation.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitg: refactoring

No more intrude include import of  coloring
Change blocks from run_global_compiler as new services of GlobalCompiler to nitg for better code reuse in subclasses
	* compile header
	* compile class names
Rename some functions from generate_ to compile_ for more uniform naming

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
typing: the return of check_subtype can distinguish safety and unsafely.

Thus visit_expr_subtype can return the correct type
as if an implicit cast was added.

Signed-off-by: Jean Privat <jean@pryen.org>
typing: new attribute AExpr::implicit_cast_to

If required, the following implicit cast ".as(XXX)"
Such a cast may by required after evaluating the expression when
a unsafe operation is detected (silently accepted by the Nit language).

The attribute is computed by `check_subtype`

Signed-off-by: Jean Privat <jean@pryen.org>
niti: implements implicit casts for unsafe nexpr

Signed-off-by: Jean Privat <jean@pryen.org>
tests: fix test_attr_easy.res for the new model.

Commit d2992803b added a space in the representation of generic types,
thus changed an error message.

Signed-off-by: Jean Privat <jean@pryen.org>