New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behavior of std
overriding and desugaring.
#1128
Comments
The optimisations that replace std functions with their native equivalents need to be aware that std has been redefined, which shouldn't be too hard to implement. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go implementation differs from C++ implementation when overriding the
std
binding and invoking an operator that desugars to astd
library call.For example with
which would desugar to
The C++ implementation fails:
while the Go implementation prints
true
.To me, the Go behavior makes for sense than the C++ one, since breaking syntax constructs by overriding a binding seems weird. However, the C++ behavior is closer to what the "Desugaring" section of the specification mandates.
The Go implementation behaves as if it desugared to something like
I think it would be nice to have consistent behavior across implementations, and have such behavior written in the specification.
The text was updated successfully, but these errors were encountered: