typing: `interator` in for is correclty set on self

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update error messages related to `iterator` in for,

Signed-off-by: Jean Privat <jean@pryen.org>
abstract_compiler: generalize `native_array_instance`

offers the service `native_array_instance` in all compilation engines

Signed-off-by: Jean Privat <jean@pryen.org>
erasure_compiler: remove redefinition of `array_instance`

the inherited implementation from the separate compiler is
enough now that `native_array_instance` is correctly implemented.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: accept intern methods at top-level

This modification does not need a special handling in the model or engines.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: introduce intern `new` constructors (factories)

They are correctly modeled and typed but engines does not how to deal with them.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: regenerate file for improved intern methods

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: special handling of `new NativeArray`

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: accept intern `new` constructors (factories)

Signed-off-by: Jean Privat <jean@pryen.org>
java FFI: display a clean error when java module is not imported

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
compiler: Accepts `new` constructor on non pointer-based class (eg. NativeString)

Just use with a placebo receiver like in other cases.

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: implement intern `init` on NativeString

Signed-off-by: Jean Privat <jean@pryen.org>
niti: implements intern `init` for NativeString and NativeArray

Signed-off-by: Jean Privat <jean@pryen.org>
tests: add test_new_native.nit

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: simplify the call of `add_in_hierarchy`

We have all the needed model information, moreover, it is more
robust than using the AST

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: mclass2nclassdef registers the first occurrence of a class

The first one is the good one.

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: `build_a_mclassdef` reuse existing mclassdefs

In a module, a second AClassdef of a given class, that is valid for
implicit Object and implicit Sys, is now attached a single MClassDef.

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: modeling of top-level methods use `parent`

Because nclassdef is the first one, not the local one

This gives more information
modelbuilder: add `AClassdef::all_defs` to retrieve all sibling definitions

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: `build_properties` process `all_defs` at once

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