New Issue: Problem with definedConst analysis

16354, “mppf”, “Problem with definedConst analysis”, “2020-09-08T14:40:19Z”

PR #16218 added definedConst analysis for domains. This issue is noting a problematic case.

See for another potential test case.

config const option = true;
var A:[1..10] int;

proc makeDomain() {
  const D = {1..2};
  writeln("in makeDomain, D.definedConst=", D._value.definedConst);
  return D;

proc test1() {
  var D = makeDomain();
  writeln("in test, D.definedConst=", D._value.definedConst);
  writeln("D. is ", D);
  D = {2..2};
  writeln("D is now ", D);

This program prints out:

in makeDomain, D.definedConst=true
in test, D.definedConst=true
D. is {1..2}
D is now {2..2}

Which doesn’t seem right. Maybe we need to set definedConst=false for domains that are move’d into var variables?