tool_context: bashcompletion use the basename of sys.program_name

as program_name can be a complex path.

Signed-off-by: Jean Privat <jean@pryen.org>
tests: fix a typing error in some tests

Signed-off-by: Jean Privat <jean@pryen.org>
typing: generalize warning on useless type tests.

Signed-off-by: Jean Privat <jean@pryen.org>
model: MParameterType.resolve_for handle the case of primitive bounds

~~~
class G[E: Int]
   # Since Int cannot have sublclasses, E == Int
end
~~~

Signed-off-by: Jean Privat <jean@pryen.org>
modelize_classes: warn on parameter types bounded on final classes

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

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update existing savs (new warning or updates)

Signed-off-by: Jean Privat <jean@pryen.org>
model: add `MType::as_notnullable` to remove the `nullable` modifier

Signed-off-by: Jean Privat <jean@pryen.org>
src: use `as_notnullable` in code

Basically replace

~~~
if m isa MNullableType then m = m.mtype
~~~

by

~~~
m = m.as_notnullable
~~~

Signed-off-by: Jean Privat <jean@pryen.org>
tool_context: correct default for bashcompletion

Signed-off-by: Jean Privat <jean@pryen.org>
tool_context: just print the bash_completion, let the caller do what it want

Signed-off-by: Jean Privat <jean@pryen.org>
tool_context: do not need an attribute bash_completion

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

Signed-off-by: Jean Privat <jean@pryen.org>
bash_completion: add a magic script that do the bash_completion setup

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Magic configuration for bash completion

Some bash magic to lazy load and configure bash_completion for nit.

Steps for a functional installation:

0. [if you have old binaries] `$ rm c_src/nitg`
1. `$ make`
2. [optional], put the `bin` directory in your PATH
3. `$ source misc/bash_completion/nit`
4. [optional] link (or copy) `misc/bash_completion/nit` in `/etc/bash_completion.d`, or source it in `~/.bash_completion`
5. profit

Pull-Request: #617
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: type works: handle implicitly fixed formal parameters

~~~
class G[E: Int]
   # Here, since Int cannot have a subclass, then E == Int (implicitly fixed)
end
~~~

This series enhance the type system to understand this case, and give the user a warning when bounding formal parameter with final classes.

Pull-Request: #618
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: model: add `MType::as_notnullable` to remove the `nullable` modifier

Basically replace

~~~
if m isa MNullableType then m = m.mtype
~~~

by

~~~
m = m.as_notnullable
~~~

Pull-Request: #619
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>