Closed etscheelk closed 6 months ago
@etscheelk : Thanks very much for filing this, as it definitely should not be giving you an internal error as it is!
The way we currently write this pattern in Chapel is to drop any mention of an index variable at all, using for 1..4 {}
.
There was recently a brief discussion about whether Chapel should permit for _ in 1..4 {}
in https://github.com/chapel-lang/chapel/issues/24149. If you'd be a proponent of supporting that, that'd be interesting to know, and potentially worth opening a feature request issue for (depending on how strongly you feel about it).
I will take a look at why this is an internal error.
I've opened https://github.com/chapel-lang/chapel/pull/25003 to fix this issue. Like Brad said, for _
is not valid in Chapel (https://github.com/chapel-lang/chapel/issues/24149 notwithstanding), so a syntax error is emitted.
If you'd be a proponent of supporting that, that'd be interesting to know
I think this would provide some parity between the methods of ignoring the iterating variable.
While for 1..10
is nifty, if I know about the tuple component dropping, that's where my mind goes first. I believe rust allows dropping variables like this too.
At any rate, glad to get it converted to a syntax issue for the immediate future.
Summary of Problem
Description:
Attempted to discard single loop variable like
(_)
results in build error BUI-0906. Expected it to behave like how you can discard a variable in a tuple iterators, e.g.(x, _) in ...
Is this a blocking issue with no known work-arounds?
Yes (besides not trying to discard variable)
Steps to Reproduce
Source Code:
Compile command:
chpl rp.chpl
Execution command:
N/A
Associated Future Test(s):
No.
Configuration Information
Output of
chpl --version
:Output of
$CHPL_HOME/util/printchplenv --anonymize
:Back-end compiler and version, e.g.
gcc --version
orclang --version
: