fuzion
fuzion copied to clipboard
Error message for mutate when falsely using `.new` insted of `.env.new` could be improved
Using mi.new instead of mi.env.new in the example below causes the error *** panic: *** invalid mutate for Type of 'get_str#0.mi'. This error message could possibly be improved, as it might be hard to find the cause the way it is now.
wrong:
get_str =>
mi : mutate is
mi.go ()->
res := mi.new String ""
for i in 0..9 do
res <- res.get + $i
res.get
say get_str
correct:
get_str =>
mi : mutate is
mi.go ()->
res := mi.env.new String ""
for i in 0..9 do
res <- res.get + $i
res.get
say get_str