New Issue: Confusing errors generated with named operator methods

17853, "bradcray", "Confusing errors generated with named operator methods", "2021-05-28T23:07:27Z"

It seems that the compiler currently does not prevent the user from creating arbitrarily named operators, and this can result in confusion if someone (like me, ahem) accidentally types operator where they meant to type proc. For example, this afternoon, I wrote something like:

record R {
  operator foo() {
    writeln("In operator foo()");

var myR: R;;

and got the confusing error:

namedOperator2.chpl:9: error: unresolved call ''
namedOperator2.chpl:2: note: this candidate did not match:
namedOperator2.chpl:9: note: because call includes 0 arguments
namedOperator2.chpl:2: note: but function can only accept 0 arguments