Skip to content

Commit 4567da3

Browse files
authored
Add an explanatory comment
1 parent 812f8c5 commit 4567da3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ trait PatternTypeConstrainer { self: TypeComparer =>
256256
val variance = param.paramVarianceSign
257257
if variance != 0 && !assumeInvariantRefinement then true
258258
else if argS.isInstanceOf[TypeBounds] || argP.isInstanceOf[TypeBounds] then
259+
// This line was added here as a quick fix for issue #13998,
260+
// to extract GADT constraints from wildcard type arguments.
261+
// The proper fix would involve inspecting the bounds right here and performing the correct subtyping checks, the ones that are already performed by `isSubType` below,
262+
// for the same reasons for which we stopped using `SkolemType` here to begin with (commit 10fe5374dc2d).
259263
isSubType(SkolemType(patternTp), scrutineeTp)
260264
else {
261265
var res = true

0 commit comments

Comments
 (0)