Skip to content
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

Merged
merged 3 commits into from
Oct 6, 2012

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented May 19, 2011

http://d.puremagic.com/issues/show_bug.cgi?id=6036
This is posted issue into dmd-internals and digitalmars.D newsgroup.

@9rnsr 9rnsr closed this Jun 1, 2011
@9rnsr 9rnsr reopened this Jun 3, 2011
braddr pushed a commit to braddr/dmd that referenced this pull request Sep 15, 2011
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);
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@nazriel
Copy link
Contributor

nazriel commented Oct 6, 2012

Hmm, at first glance it looks good to me
@yebblies @dawgfoto what ya think about this?
Bug seems to be quite annoying and pull may start rotting soon (1 year old)

yebblies added a commit that referenced this pull request Oct 6, 2012
Issue 6036 - Constructor, static opCall and object opCall
@yebblies yebblies merged commit 098096c into dlang:master Oct 6, 2012
@nazriel
Copy link
Contributor

nazriel commented Oct 6, 2012

<3 @yebblies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants