Skip to content

Commit 2844c2b

Browse files
Handle copies of constrained type lambdas when determining an implicit scope (#16159)
Fixes #16146
2 parents 93a93ab + ab79724 commit 2844c2b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ trait ImplicitRunInfo:
627627
traverse(t.underlying)
628628
case t: TermParamRef =>
629629
traverse(t.underlying)
630+
case t: TypeLambda =>
631+
for p <- t.paramRefs do partSeen += p
632+
traverseChildren(t)
630633
case t =>
631634
traverseChildren(t)
632635

tests/neg/i16146.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
type N = [X] => (X => X) => X => X
3+
val exp = (a: N) => (b: N) => b(a) // error

0 commit comments

Comments
 (0)