treat resolved symbols on RHS of module qualification as identifiers #24180
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 #19866 given #23997
When searching for a module-qualified symbol,
qualifiedLookUp
tries to obtain the raw identifier from the RHS of the dot field. However it only does this when the RHS is either annkIdent
or annkAccQuoted
node, not when the node is a resolved symbol or a symchoice, such as in templates and generics when the module symbol can't be resolved yet. Since the LHS is a module symbol when the compiler checks for this, any resolved symbol information doesn't matter, since it has to be a member of the module. So we now obtain the identifier from these nodes as well as the unresolved identifier nodes.The test is a bit niche and possibly not officially supported, but this is likely a more general problem and I just couldn't think of another test that would be more "proper". It's better than the error message
'a' has no type
at least.