Open
Description
Currently, Annotations.refersToParamOf
assumes that all TermParamRef
types will only appear as the (root) type of Ident
or This
trees:
scala3/compiler/src/dotty/tools/dotc/core/Annotations.scala
Lines 75 to 82 in 912b6f2
This assumption can be invalidated, for example when trees are generated by macros.
See #22001 (comment) for prior discussion. I proposed two fixes there.
To do:
- write test-cases,
- find the minimal fix:
refersToParamOf
should visit the least possible number of trees and types.