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 23651 - Order dependency in semantic analysis of template members #14843

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

WalterBright
Copy link
Member

AliasDeclarations should behave like other declarations w.r.t. being able to be lazily semantically evaluated.

@WalterBright WalterBright added the Severity:Refactoring No semantic changes to code label Jan 24, 2023
@dlang-bot
Copy link
Contributor

dlang-bot commented Jan 24, 2023

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
23651 normal Order dependency in semantic analysis of template members

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

@WalterBright WalterBright force-pushed the aliassem branch 5 times, most recently from 9737717 to 4798bef Compare January 24, 2023 06:16
@WalterBright WalterBright changed the title AliasDeclaration semantic fix Issue 23651 - Order dependency in semantic analysis of template members Jan 24, 2023
@ibuclaw
Copy link
Member

ibuclaw commented Jan 24, 2023

At what point should we just put resolving in a visitor or similar encapsulated interface so it isn't just a little special case here, a little bit there, all over the place?

Not that it would solve anything, but might least make it easier to grok what's going on, and allow resolve/match symbols consistently without semantic getting in the way. (Write a spec, follow the spec).

Half of this just looks like treating the visible mould, but actually it's taken over the entire wall.

@WalterBright
Copy link
Member Author

@ibuclaw I actually agree with you. Before I did this PR, I spent a couple frustrating days trying more fundamental solutions, but they'd all fail with weird problems. I'm not happy with this solution, but it has the positive characteristic of working.

resolve/match symbols consistently without semantic getting in the way

Yeah, well, static if gets in the way of that.

@WalterBright
Copy link
Member Author

mixin too.

@ibuclaw
Copy link
Member

ibuclaw commented Jan 25, 2023

mixin too.

Mixins yes, though I wonder if there could be a construct for a function/type/variable inside any form of conditional declaration, where if the condition it depends upon results as true, use it, otherwise pass the next matched symbol in scope/import. Would mean doing a light form of semantic on all possible code paths though before we decide keep or discard. I'm probably being too optimistic.

@dlang-bot dlang-bot merged commit 0b2e3a5 into dlang:master Jan 25, 2023
Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

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

Not great, as now there's yet another "avoid semantic on..." block.

@WalterBright WalterBright deleted the aliassem branch January 25, 2023 01:34
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.

3 participants