-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Issue 6036 - Constructor, static opCall and object opCall #72
Conversation
Issue 5837 - Unable to format (writeln) an enum based on bool
// Rewrite as e1.call(arguments) | ||
Expression *e = new DotIdExp(loc, e1, Id::call); | ||
e = new CallExp(loc, e, arguments); | ||
e = e->trySemantic(sc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the trySemantic necessary - if there's an opCall, it better match or there's an error. There should not be a fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for construction with literal form.
Using static opCall for object construction is not recommended, but is still valid.
And we can also make static opCall functions not for the construction.
(I've never heard that the operator overloading with static opCall
is marked as deprecated in D2.)
So masking literal form by static opCall is not good, and there should be a fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I removed using trySemantic
. Now any opCall definitions always block using literal syntax.
Exceptional cases: 1. In typeof expression. 2. In aggregate DeclDefs scope.
Hmm, at first glance it looks good to me |
Issue 6036 - Constructor, static opCall and object opCall
<3 @yebblies |
http://d.puremagic.com/issues/show_bug.cgi?id=6036
This is posted issue into dmd-internals and digitalmars.D newsgroup.