You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error at program.fut:1:9-9:
Unexpected token: '1'
Expected one of the following: '='
If you find this error message confusing, uninformative, or wrong, please open an issue:
https://github.com/diku-dk/futhark/issues
Two solutions are possible: either change the grammar in the language reference, or allow this in the parser and instead fail during type checking.
The reason for this is that we don't want to allow refutable patterns in let bindings and function parameters. However, that also means we currently don't allow things like def f (#foo x) = ... where #foo is from a single-constructor type. That hardly comes up frequently, but we might want to allow it.
According to the language reference, Futhark allows literals as patterns, meaning that the following code should be accepted:
However, the current parser does not allow this:
Playground link
The text was updated successfully, but these errors were encountered: