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

Fix Issue 23010 - mixed in aliaseqs used as type don't initialize #14237

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

BorisCarvajal
Copy link
Member

TupleDeclaration elements were inserted to the members array of
current ScopeDsymbol but TemplateMixin declarations are already
expanded in statement level and this confused DMD backend.
After adding some code to insert tuple elements to AggregateDeclaration.fields
and for parsing tuples in toObjFile, the code in question can be removed.
No more hidden symbols (like __tuple_field_0) inside any members field.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @BorisCarvajal!

Bugzilla references

Auto-close Bugzilla Severity Description
23010 major mixed in aliaseqs used as type dont initualize

Testing this PR locally

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

dub run digger -- build "master + dmd#14237"

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

This looks fine to me, cc @kinke @ibuclaw as this alters glue code

@BorisCarvajal
Copy link
Member Author

It seems C++ header generation is better now using fields instead of members when generating default constructors.
I'm gonna check later.

src/dmd/dsymbolsem.d Outdated Show resolved Hide resolved
@ibuclaw
Copy link
Member

ibuclaw commented Jun 22, 2022

This looks fine to me, cc @kinke @ibuclaw as this alters glue code

This is a no-op on my end. Incidentally I'm already doing the same as the added TupleDeclaration visit method here so that all declared local variables within tuples get properly added to the current binding scope - symbols can't just appear from thin air unlike in dmd's codegen/backend.

@BorisCarvajal
Copy link
Member Author

Moved some dtoh changes to #14239

@thewilsonator
Copy link
Contributor

Dependant PR merged

@BorisCarvajal BorisCarvajal force-pushed the fix23010 branch 2 times, most recently from d89c129 to b98cd4c Compare June 24, 2022 08:22
`TupleDeclaration` elements were inserted to the `members` array of
current `ScopeDsymbol` but `TemplateMixin` declarations are already
expanded in statement level and this confused DMD backend.
After adding some code to insert tuple elements to `AggregateDeclaration.fields`
and for parsing tuples in `toObjFile`, the code in question can be removed.
No more hidden symbols (like `__tuple_field_0`) inside any `members` field.
@dlang-bot dlang-bot merged commit 5e981f0 into dlang:master Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants