Open danieltuveson opened 8 months ago
Thanks for reporting this Daniel! Just so you know, Roc does not allow redefinition. We should of course print a nice error message when the user tries it!
Yep, I assumed as much! Sometimes languages that don't allow redefinition do allow redefinition within the REPL (Haskell and GHCI, for instance), that way you don't need to restart the REPL to change the definition of a function, for example. But mainly I wanted to note that it panics instead of giving a compiler error.
Just hit the same issue—can a better error message for this please be prioritized? People coming to Roc from imperative languages are going to hit this almost immediately, and a more informative error message would help first contact.
If I type in
x = 1
into the REPL at roc-lang.org and then try to redefine it asx = 2
, the interpreter crashes with the following error: