Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for mutate when falsely using .new insted of .env.new could be improved #3344

Open
simonvonhackewitz opened this issue Jul 9, 2024 · 0 comments
Labels
base library related to the Fuzion base library enhancement New feature or request

Comments

@simonvonhackewitz
Copy link
Contributor

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
@michaellilltokiwa michaellilltokiwa added enhancement New feature or request base library related to the Fuzion base library labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base library related to the Fuzion base library enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants