Skip to content

[RFC] Fix issue 12285, issue 12286, issue 12230 #3345

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

Closed
wants to merge 3 commits into from

Conversation

CyberShadow
Copy link
Member

https://d.puremagic.com/issues/show_bug.cgi?id=12285
https://d.puremagic.com/issues/show_bug.cgi?id=12286
https://d.puremagic.com/issues/show_bug.cgi?id=12230

DEPENDS ON #2824

This fixes some inconsistencies with template alias parameters (12230) while avoiding breaking code (12285, 12286).

This pull request is experimental and a work-in-progress, please don't merge yet.

@CyberShadow
Copy link
Member Author

@9rnsr Please have a look at this. 12230 is basically the same thing you did for 11946 but for methods. It will break some code, but it will be dampened by 12285 and 12286 which recognize some new valid cases, and for the remaining cases the same workaround you suggested in comment #1 on 11946 will work here too (see the adjustment to the test case for 9130 for an example).

Also this appears to depend on your pull #2824 which I don't know why isn't merged yet.

BTW, I like your "static alias" proposal on http://wiki.dlang.org/Brush_Up_Language_Features#Nested_Symbols. I think that it will solve the remaining cases that this change will affect.

if ((td && td->literal) ||
(ti && ti->enclosing) ||
(d && !d->isDataseg() &&
!(d->storage_class & STCmanifest) &&
(!d->isFuncDeclaration() || d->isFuncDeclaration()->isNested()) &&
(!f || f->isNested() || f->isThis()) &&
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're missing some parentheses here:

(!f || (f->isNested() || f->isThis())) &&

Or you may end up dereferencing NULL.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, nevermind, forgot about short-circuit.

@ghost
Copy link

ghost commented Apr 11, 2014

This LGTM. @9rnsr what do you think?

@CyberShadow
Copy link
Member Author

This pull request is a good deal less useful without alias parameters to fields binding context to templates, which has now been reverted. So I'm going to close this for now.

ibuclaw pushed a commit to ibuclaw/dmd that referenced this pull request Jul 10, 2022
Fix issue 21309 along with other dead links on dlang.org
merged-on-behalf-of: Mathias LANG <pro.mathias.lang@gmail.com>
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.

1 participant