Skip to content

Commit dac1813

Browse files
authored
Merge pull request #12135 from dotty-staging/fix-12127
Normalize before querying for tuple component types
2 parents 056c897 + 6b70e16 commit dac1813

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

+1-1
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

compiler/test/dotc/pos-test-pickling.blacklist

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ i11236.scala
3636
i11247.scala
3737
i11250
3838
i9999.scala
39+
i12127.scala
3940

4041
# Opaque type
4142
i5720.scala

tests/pos/i12127.scala

+5
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)