Skip to content

Commit fd25d29

Browse files
mboveltgodzik
authored andcommitted
Consider all arguments in Annotations.refersToParamOf
[Cherry-picked 63dc305]
1 parent c4a7bb8 commit fd25d29

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object Annotations {
7373

7474
/** Does this annotation refer to a parameter of `tl`? */
7575
def refersToParamOf(tl: TermLambda)(using Context): Boolean =
76-
val args = arguments
76+
val args = tpd.allArguments(tree)
7777
if args.isEmpty then false
7878
else tree.existsSubTree {
7979
case id: Ident => id.tpe.stripped match
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class annot[T] extends annotation.Annotation
2+
class Box[T]()
3+
def f(x: Int): Int @annot[Box[x.type]] = x
4+
def test =
5+
val foo = f(42)

0 commit comments

Comments
 (0)