[Bug]: const ref
attached to vararg formal arguments allows their modification
#25901
Labels
const ref
attached to vararg formal arguments allows their modification
#25901
Summary of Problem
Description:
This is the remaining issue tracked by #25858 which I wasn't able to solve yet.
The individual arguments passed to a
const ref
varargs should behave the same as though they were passed to aconst ref
tuple or individually - they should trigger an error about modifying aconst
if the body of the function tries to modify them. However, today a program that does so compiles without issue and allows modification to occur.This was easily solved for
const
andconst in
, butconst ref
for some reason is proving more elusive.Is this issue currently blocking your progress?
No, just tracking it
Steps to Reproduce
Source Code:
Compile command:
chpl foo.chpl
Execution command:
N/A - should fail at compilation, but does not
Associated Future Test(s):
test/functions/varargs/constRefVarargs.chpl
#25902Configuration Information
chpl --version
: 2.2.0 pre-release$CHPL_HOME/util/printchplenv --anonymize
: anygcc --version
orclang --version
: anymodule list
: N/AThe text was updated successfully, but these errors were encountered: