Closed
Description
We allow patterns on 1-tuples, at least in theory:
match z {
(x,) => { ... }
}
The parser code for 1-tuple patterns didn't quite work as intended, and I fixed that. But then I ran into the problem that I couldn't write a test because there's no way to write a 1-tuple literal or type ((x)
gets parsed as x
).
Is this intentional? It seems like if we're going to allow 1-tuple patterns, we should also allow 1-tuple terms (perhaps with the same (x,)
syntax?)
This came up, as you might expect, because of macros: I was trying to replace structural records with tuples in the pipes code (that seemed easier than dynamically generating new struct type names) and I ran into the parser problem, which I was able to fix but not test.