-
Notifications
You must be signed in to change notification settings - Fork 34
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
[]
parsed incorrectly leading to unrelated error message
#1468
Comments
Workaround: use |
I stumbled upon a similar issue while writing typescript and the autoformatter immediately made me understand I wrote something different then what I expected. I wrote const a = foo(x)
[a, bar] (forgetting the const a = foo(x)[a, bar] which made me realize something was wrong. |
A similar issue was reported by @angbrav involving tuple constructors and operator calls. In this example, one tuple construction ( module test {
pure def foo(x) =
pure val bar = x
(bar, 1)
pure def foo2(x) =
pure val baz = x.head()
x
} is parsed as module test {
pure def foo(x) =
pure val bar = x(bar, 1)
pure def foo2(x) =
pure val baz = x.head { Tup() }
x
} |
Wrapping the first top-level def in curly braces fixes the problem: module test {
pure def foo(x) = {
pure val bar = x
(bar, 1)
}
pure def foo2(x) =
pure val baz = x.head()
x
} |
I just stumbled upon a similar issue as @angbrav . I cannot create a minimal example (because I do not udnerstand what exactly is happening) so let me describe how/when the problem occurs.
Is it an instance of the same error? To the best of my understanding, any number of helper |
@ivan-gavran I'd guess not the number of |
Using
[]
like this:causes a completely unrelated error about cyclic definitions:
because this is (wrongfully) parsed as:
The text was updated successfully, but these errors were encountered: