tokiwa-software / fuzion

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

type popagation should also work from array type to initialisation function #3249

Open simonvonhackewitz opened 1 week ago

simonvonhackewitz commented 1 week ago

The code is from idiom 275 in tokiwa-software/fuzion-idioms#144

This works:

s := "0111111100101010"

array s.byte_length/8 i->
  s.substring i*8 i*8+8
   .parse_integer u8 2

This does not work, but would be nice if type propagation worked in this direction as well:

s := "0111111100101010"

array u8 s.byte_length/8 i->
  s.substring i*8 i*8+8
   .parse_integer 2