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 getType on object/distinct types giving bare generic sym #24510

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Dec 5, 2024

fixes #24503, refs #22655, alternative to #24509

This removes the need for the fix in #22655 entirely, since getType no longer gives nodes with invalid tyGenericBody types for types that are actually instantiated. But it significantly changes the output of getType, and likely not in a great way. Maybe an inst=true version of t.typeInst would be better, but this also changes the output, and t.typeInst was only fixed recently for types without generic fields in #24425 (also the dereferenced types of generic ref objects still give the ref object type as the typeInst).

There is also this line that has a similar issue, but it doesn't seem to be encountered, likely because skipped tyGenericInst types aren't very common when using getTypeInst.

Alternatively we could still produce a sym node but just set its type to the current type, i.e. result = atomicType(t.sym); result.typ = t. Edit: Done in #24511 just to test

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.

Building some applications causes whole system to crash (out of memory)
1 participant