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

Move toParentDecl to toParentLocal and make a new toParentDecl() which follows the declaration scope even for static templates #9647

Merged
merged 5 commits into from Apr 22, 2019

Conversation

SSoulaimane
Copy link
Member

@SSoulaimane SSoulaimane commented Apr 18, 2019

This is the correct behavior.
Includes a test case.

Edit: some code such as test/compilable/b16483.d and some tests I added relied on the old behavior so I kept it with another variant called toParentLocal() which doesn't follow non-local (i.e. global and static) templates. toParentLocal is even more useful when two local contexts exist (#9282).

@dlang-bot
Copy link
Contributor

dlang-bot commented Apr 18, 2019

Thanks for your pull request and interest in making D better, @SSoulaimane! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
6541 normal using synchronized on a templated method crashes the compiler

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#9647"

@jacob-carlborg
Copy link
Contributor

Is this fixing some issue? In that case please create a bugzilla issue and reference so it show up in the changelog.

@SSoulaimane
Copy link
Member Author

Is this fixing some issue? In that case please create a bugzilla issue and reference so it show up in the changelog.

Yes it is. Added.

@SSoulaimane SSoulaimane force-pushed the parentDeclfix branch 2 times, most recently from b1333d5 to eed7f4a Compare April 19, 2019 15:30
@SSoulaimane SSoulaimane force-pushed the parentDeclfix branch 4 times, most recently from a087cb0 to 25eeea4 Compare April 21, 2019 19:09
@SSoulaimane SSoulaimane changed the title Make toParentDecl() follow the declaration scope even for static templates Move toParentDecl to toParentLocal and make a new toParentDecl() which follows the declaration scope even for static templates Apr 21, 2019
@SSoulaimane
Copy link
Member Author

Since some code relies on the current behavior I kept it under a different nametoParentLocal. this toParentLocal was coming anyway with #9282.

src/dmd/dsymbol.h Outdated Show resolved Hide resolved
@dlang-bot dlang-bot merged commit 40d85cf into dlang:master Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants