Skip to content

dmd.expressionsem: Call copy() on default argument from CallExp semantic#14214

Closed
ibuclaw wants to merge 1 commit intodlang:masterfrom
ibuclaw:inlinecopy
Closed

dmd.expressionsem: Call copy() on default argument from CallExp semantic#14214
ibuclaw wants to merge 1 commit intodlang:masterfrom
ibuclaw:inlinecopy

Conversation

@ibuclaw
Copy link
Copy Markdown
Member

@ibuclaw ibuclaw commented Jun 14, 2022

With this, the only entrypoint into the front-end inliner would be dmd.mars.

As of #3885, CallExp semantic no longer does early lowering of struct literal constructors into a DeclarationExp, which triggered the backend ICE in bugzilla 2935 - if there is any lowering required, that is appropriately dealt with by functionParameters() after a copy of defaultArg has been made.

So it is now safe to do a plain copy, instead of implicitly calling the front-end inliner to perform a deep copy of the node.

As noted in the original bugzilla issue, a visitor/walker would also suffice to do a deep copy of any nested DeclarationExp's, but I don't see that as necessary anymore as that possibility looks to be no longer reachable.

CC: @WalterBright - because you were the one who cried "Danger, Will Robinson!"

This partiallly reverts commit b5ea872.

@ibuclaw ibuclaw requested a review from WalterBright June 14, 2022 10:51
@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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#14214"

@ibuclaw ibuclaw changed the title dmd.expressionsem: Call copy() on default argument from CallExp semantic dmd.expressionsem: Call syntaxCopy() on default argument from CallExp semantic Jun 14, 2022
@ibuclaw ibuclaw changed the title dmd.expressionsem: Call syntaxCopy() on default argument from CallExp semantic dmd.expressionsem: Call copy() on default argument from CallExp semantic Jun 14, 2022
@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Jul 16, 2022

Superseded by #14309.

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.

2 participants