Skip to content

Commit 03da9dd

Browse files
authored
Merge pull request #15748 from dotty-staging/fix-15687
Avoid null types when reducing match types
2 parents 62ca3fc + d6dd904 commit 03da9dd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2988,7 +2988,7 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
29882988
def redux(canApprox: Boolean): MatchResult =
29892989
caseLambda match
29902990
case caseLambda: HKTypeLambda =>
2991-
val instances = paramInstances(canApprox)(new Array(caseLambda.paramNames.length), pat)
2991+
val instances = paramInstances(canApprox)(Array.fill(caseLambda.paramNames.length)(NoType), pat)
29922992
instantiateParams(instances)(body) match
29932993
case Range(lo, hi) =>
29942994
MatchResult.NoInstance {

tests/neg/i15687.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
val _ = summon[Tuple.IsMappedBy[[X] =>> Int][(4, 2)]] // error
2+

0 commit comments

Comments
 (0)