Skip to content

Comments

semantic3: Fix more assertions if TypeInfo_AssociativeArray is misdefined#22143

Merged
thewilsonator merged 1 commit intodlang:masterfrom
ibuclaw:ti_aa_mismatch
Nov 24, 2025
Merged

semantic3: Fix more assertions if TypeInfo_AssociativeArray is misdefined#22143
thewilsonator merged 1 commit intodlang:masterfrom
ibuclaw:ti_aa_mismatch

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Nov 24, 2025

Probably the error may need to be more descriptive (say what kind of template function is expected). Anything is better than ICE'ing.

@ibuclaw ibuclaw requested a review from rainers November 24, 2025 17:05
@dlang-bot
Copy link
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#22143"

ti.xtoHash = e.isVarExp().var;
if (auto tmpl = ti.xtoHash.parent.isTemplateInstance())
tmpl.minst = sc2._module.importedFrom; // ensure it gets emitted
if (!e.isVarExp() || !e.type.isTypeFunction())
Copy link
Member

@rainers rainers Nov 24, 2025

Choose a reason for hiding this comment

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

Should this test include the ti.xtoHash.parent.isTemplateInstance() check, too? Otherwise the message might not match the condition.

Copy link
Member Author

Choose a reason for hiding this comment

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

makeDotExp returns a DotTemplateInstanceExp, so if it doesn't resolve to a template, then its value will be an ErrorExp.

@thewilsonator thewilsonator merged commit 69074bd into dlang:master Nov 24, 2025
42 checks passed
@ibuclaw ibuclaw deleted the ti_aa_mismatch branch November 24, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants