New Issue: Should we check the visibility of forwarded methods earlier?

17717, "lydia-duncan", "Should we check the visibility of forwarded methods earlier?", "2021-05-13T15:51:20Z"

We encountered an issue when dealing with operator methods on classes: because owned/shared/etc is implemented as a wrapper type that forwards to the class being managed and forwarded methods are only considered if no methods are found on the wrapper type, we were finding operator definitions on the wrapper type and never considering operator methods defined on the managed class type.

To avoid this, we now check canonical type methods at the same time as we check methods on the management wrapper.

However, this brings up concerns about when an operator returns something of the same type, for example +. We're worried that the type of the result of + might be surprising. It's probably moot since the operators presumably have to specify a management style for what is returned, but we're not certain.

Should this reasoning be extended to all forwarded operators that return bool (or perhaps to such operators for types that the type can implicitly convert to)?

Is this reasonable specifically for operators returning something other than bool e.g. +?