New Issue: Should compiler-generated assignment use field accessors?

20472, "benharsh", "Should compiler-generated assignment use field accessors?", "2022-08-18T20:23:39Z"

Consider the following program:


record R {
  var x : int;

  proc x ref {
    writeln("R.x accessor");
    return x;
  }
}

proc main() {
  var a = new R(5);
  var b = new R(10);
  writeln("-----");
  a = b;
  writeln("-----");
  writeln(a);
  writeln(b);
}

This program currently prints: