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
Fix 22730 - Promote imported files (-i) to root module before parsing the declarations. #13654
Fix 22730 - Promote imported files (-i) to root module before parsing the declarations. #13654
Conversation
Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + dmd#13654" |
926ddd7
to
86a559e
Compare
86a559e
to
d8fd646
Compare
d8fd646
to
be89688
Compare
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'm not sure I follow the logic. Why is the static assert
in lib.ignores.unittests
not triggering ?
S.t. the `module x.y.z` can be parsed independent of the module content. This is required to eagerly determine whether an imported files should be promoted to a root module when compiling with `-i`. (it's currently done after the entire module was parsed).
... the declarations. DMD PR 13224 changed the parser s.t. unittests from non-root modules are skipped, i.e. not even parsed. The new behaviour didn't work as expected when combined with `-i` because it promoted imported files to root modules *after* the parser processed the entire file. This commit moves the existing checks s.t. they are applied immediatly after the module declaration was read by the parser.
be89688
to
ea623db
Compare
|
I've changed the test to a |
#13224 changed the parser s.t. unittests from non-root modules are skipped, i.e. not even parsed. The new behaviour didn't work as expected when combined with
-i
because it promoted imported files to root modules after the parser processed the entire file.The first commit splits the module parsing into dedicated methods for the module declaration and content. The second commit then moves the existing checks s.t. they are applied immediatly after the module declaration and before the first unittest.