Skip to content

Commit 1e7e3f7

Browse files
authored
Merge pull request #9092 from dotty-staging/fix-fix-9061
Fix variance fixing code in the fix of #9061
2 parents b852e14 + 8d4b2a6 commit 1e7e3f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ class Namer { typer: Typer =>
10091009
case tp: TypeBounds =>
10101010
def recur(tp: Type): Type = tp match
10111011
case tp: HKTypeLambda if !tp.isDeclaredVarianceLambda =>
1012-
tp.withVariances(tp.paramNames.map(alwaysInvariant))
1013-
.derivedLambdaType(resType = recur(tp.resType))
1012+
val tp1 = tp.withVariances(tp.paramNames.map(alwaysInvariant))
1013+
tp1.derivedLambdaType(resType = recur(tp1.resType))
10141014
case tp => tp
10151015
tp.derivedTypeBounds(tp.lo, recur(tp.hi))
10161016
case _ =>

tests/pos/nestedLambdas.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class Test {
1010

1111
val y: A[Int][Boolean] = x
1212

13-
def f[X <: T[Int]] = ???
13+
def f[X <: [Y] =>> T[Int][Y]] = ???
1414

1515
f[A[Int]]
1616

17-
def g[X <: T] = ???
17+
def g[X <: [Y] =>> [Z] =>> T[Y][Z]] = ???
1818

1919
g[A]
2020

0 commit comments

Comments
 (0)