syntax: variable assignment can bypass cast
authorJean Privat <jean@pryen.org>
Mon, 22 Jun 2009 18:07:07 +0000 (14:07 -0400)
committerJean Privat <jean@pryen.org>
Wed, 24 Jun 2009 19:47:49 +0000 (15:47 -0400)
commit426478abcd8ea04891a0fb4839a246ee0d13ea0f
tree5bb93ab8c1657cc2a93a9a82ac60f634e9197316
parent60feadd7fc3ea18e3b3de99c20364b8f47c81574
syntax: variable assignment can bypass cast

Bypassing is allowed if it is conform to the 'base' type of the variable.
The 'base' type of the variable is set before while, for and closures.

Bypassing also means that casted type must propagate trough flow control.

Some tests are updated to avoid unexpected cast flow.

Signed-off-by: Jean Privat <jean@pryen.org>
15 files changed:
src/syntax/control_flow.nit
src/syntax/typing.nit
tests/base_classid.nit
tests/base_isa_cast.nit
tests/base_isa_cast2.nit
tests/base_isa_cast4.nit [new file with mode: 0644]
tests/base_isa_nil.nit
tests/sav/base_isa_cast2.sav
tests/sav/base_isa_cast2_alt8.sav
tests/sav/base_isa_cast4.sav [new file with mode: 0644]
tests/sav/base_isa_cast4_alt1.sav [new file with mode: 0644]
tests/sav/base_isa_cast4_alt2.sav [new file with mode: 0644]
tests/sav/base_isa_cast4_alt3.sav [new file with mode: 0644]
tests/sav/base_isa_cast4_alt4.sav [new file with mode: 0644]
tests/sav/base_isa_cast4_alt5.sav [new file with mode: 0644]