Skip to content

Commit 17f465f

Browse files
committed
Normalize before querying for tuple component types
Fixes #12127
1 parent 3bcdc34 commit 17f465f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ object Applications {
118118
}
119119

120120
def tupleComponentTypes(tp: Type)(using Context): List[Type] =
121-
tp.widenExpr.dealias match
121+
tp.widenExpr.dealias.normalized match
122122
case tp: AppliedType =>
123123
if defn.isTupleClass(tp.tycon.typeSymbol) then
124124
tp.args

tests/pos/i12127.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
val x = Option((1, 2, 3)).map(_ + _ + _)
2+
def foo[T <: Tuple : Tuple.IsMappedBy[Option]](t: T)(f: Tuple.InverseMap[T, Option] => Int) = null
3+
val y = foo(Option(1), Option(2), Option(3))(_ + _ + _)
4+
5+
//val x: (Tuple3[Int, Int, Int] => Int) = _ + _ + _

0 commit comments

Comments
 (0)