Frank Heckenbach wrote:
I just realize one issue with user-defined operators that might not have been discussed here yet, shadowing.
If an operator is defined in outer and inner scopes, say with different enough argument types, is the outer one still accessible in the inner scope (i.e., the inner one overloads the outer one) (a), or not accessible (i.e., shadows) (b)?
Well I am tempted to forbid definitions in inner scopes. Why ? One can treat object method call as a "generic" function. When calling method the actual function is chosen based on the type of the object. If you allow objects in inner scopes similar difficulties appear. I would like overloading to be like method dispatch, so it is natural to share the restriction.