tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

Argument type inference in constructor results in crash during DFA when arg field is accessed #3246

Open fridis opened 5 months ago

fridis commented 5 months ago

This example infers the type of `p.x' from the actual argument

p(x) is
s (p 3)
s(v p) => say v.x

But this crashes during DFA on the access to the boxed value of v.x:

 > ./build/bin/fz test_typeinference.fz

$MODULE/io/print_effect.fz:55:14: error 1: NYI: in ((io.#type io).out.#type io.out).default_print_handler.println(1 args) at 805306473 no targets for Call Any.as_string(outer Any) String target i32:3
    print (s.as_string + (codepoint 10))
-------------^^^^^^^^^
Considered targets: Any, Const_String, 
michaellilltokiwa commented 2 weeks ago

x is wrongly inferred to be void at some point, but later changes to i32.

p(x void) is
s (p 3)
s(v p) => say v.x