New Issue: Support for operators in forwarding only/except lists, and in imports and only/except lists for use statements

17003, “lydia-duncan”, “Support for operators in forwarding only/except lists, and in imports and only/except lists for use statements”, “2021-01-25T23:20:34Z”

I was originally skeptical that we would want to be able to list operators explicitly in use/import statements (as generally it seemed like I would care more about individual types the operators apply to rather than wanting all versions of + in scope, for instance), but willing to support it if requested. However, when forwarding a type that has an operator method, it seemed obvious that users would want a way to explicitly opt in or out of forwarding operator methods defined on the type. For instance,

record Container {
  var x: OtherType;

  forwarding var only <; // or `forwarding var except +`
}

record OtherType {
  var y: int;
}
proc type OtherType.+(lhs: OtherType, rhs: OtherType) {
  return new OtherType(lhs.y + rhs.y);
}

proc type OtherType.<(lhs: OtherType, rhs: OtherType) {
  return lhs.y < rhs.y;
}

With that motivating use case, it seems reasonable to also add the support to use/import statements, since the only/except lists are similar