whitelist generic params matching typedesc
for templates/macros
#23438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #23432
After #22029 generic parameter types no longer match
typedesc
parameters in overloading, as this previously instantiated procs with an unresolved type as atypedesc
value. However macros and templates don't use the same mechanism for generic instantiation, cannot delay their instantiations further than the point that they get compiled (i.e. are generically instantiated) and can inspect types more precisely anyway, so for practicality purposes we can whitelist them fortypedesc
and keep old code working.If whitelisting macros and templates isn't sufficient (i.e. in cases where
c.calleeSym
is nil) we can also blacklist runtime routines (c.calleeSym != nil and c.calleeSym.kind in (routineKinds - {skMacro, skTemplate})
).