New Issue: Poor const-related error messages

16490, “vasslitvinov”, "Poor const-related error messages ", “2020-09-28T20:06:46Z”

Example 1:

class MyClass { }
var myC = new MyClass()?;

proc libFun(myArg) {
  var myClass = myArg: class; // error here
}
proc main {
  libFun(myC);
}

currently reports

error: const actual is passed to a 'ref' formal of chpl__initCopy()

whereas it should say ex. “cannot transfer ownership from a const variable”

Example 2

class MyClass { }
const c1 = new MyClass();

proc myFun(myArg) {
  var c2 = new MyClass();
  c2 = myArg;  // error here
}
proc main {
  myFun(c1);

  var c3 = new MyClass();
  c3 = c1;  // error here
}

currently reports

error: cannot assign to const variable

whereas it should similarly say ex. “cannot transfer ownership from a const variable”

Chapel default configuration, chpl version: 1.23.0 pre-release (1b513e2cda)

Tests: forthcoming.