New Issue: Compiler complains about 'in' task intent being passed to 'ref' because it's 'const'

19737, "bradcray", "Compiler complains about 'in' task intent being passed to 'ref' because it's 'const'", "2022-05-02T22:23:57Z"

Summary of Problem

In some cases, it seems that the compiler complains when a user-inserted temporary created using in is passed to a ref intent formal, complaining that the actual is const. Yet, an in copy shouldn't be considered constant by default. Confusingly, I have not yet been able to reproduce this in a simpler example, but this is the idea behind the pattern:

var A: [1..10] real;
const ref B = A[1..3];
begin with (in B) foo(B);

proc foo(X: [?D]) {
  writeln(X);
}

Steps to Reproduce

Associated Future Test(s):
test/studies/shootout/reverse-complement/bradc/revcomp-blc-begin-const-ref.chpl #19736

Configuration Information

  • Output of chpl --version: chpl version 1.27.0 pre-release (e7ad193c48)