File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,10 @@ trait PatternTypeConstrainer { self: TypeComparer =>
275275 argP.typeSymbol.isPatternBound && patternTp.classSymbol == scrutineeTp.classSymbol
276276 then
277277 val TypeBounds (loS, hiS) = argS.bounds
278+ val TypeBounds (loP, hiP) = argP.bounds
278279 var res = true
279- if variance < 1 then res &&= isSubType(loS, argP )
280- if variance > - 1 then res &&= isSubType(argP , hiS)
280+ if variance < 1 then res &&= isSubType(loS, hiP )
281+ if variance > - 1 then res &&= isSubType(loP , hiS)
281282 res
282283 else true
283284 }
Original file line number Diff line number Diff line change 1+ class Inv [A ]
2+
3+ class Foo [B , M [_]]
4+
5+ class Bar [C , N [_]] extends Foo [C , N ]:
6+ def inv : Inv [C ] = null
7+
8+ def test (foo : Foo [Int , Option ]): Inv [Int ] = foo match
9+ case bar : Bar [_, _] => bar.inv
10+ case _ => null
You can’t perform that action at this time.
0 commit comments