28922, "arifthpe", "Decl with var name in parens gives tuple error, should be syntax", "2026-06-03T18:52:34Z"
opened 06:52PM - 03 Jun 26 UTC
type: Error Message
For a declaration such as the following (with or without parens on `int`):
```ch… apel
var (x): (int);
```
We get the following error message:
```
error: illegal tuple variable declaration with non-tuple initializer
```
At time of writing, this behavior is [locked in by test `types/tuple/bradc/onedetuple-error.chpl`](https://github.com/chapel-lang/chapel/blob/a4e1950af0806e24028ff5d0b8b4fd7d0c7df012/test/types/tuple/bradc/onedetuple-error.chpl).
However, it's confusing for the error to consider this a tuple variable declaration, because `(x)` is not a valid way to write a 1-tuple (would need a trailing comma). Instead, it would make more sense for this to just be a syntax error, due to the variable name being in parens and therefore not a valid identifier.
For a declaration such as the following (with or without parens on int):
var (x): (int);
We get the following error message:
error: illegal tuple variable declaration with non-tuple initializer
At time of writing, this behavior is locked in by test types/tuple/bradc/onedetuple-error.chpl .
However, it's confusing for the error to consider this a tuple variable declaration, because (x) is not a valid way to write a 1-tuple (would need a trailing comma). Instead, it would make more sense for this to just be a syntax error, due to the variable name being in parens and therefore not a valid identifier.