We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dca4a6 commit 5c5189eCopy full SHA for 5c5189e
compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala
@@ -143,10 +143,10 @@ trait PatternTypeConstrainer { self: TypeComparer =>
143
ctx.gadt.bounds(scrut.symbol) match {
144
case tb: TypeBounds =>
145
val hi = tb.hi
146
- constrainPatternType(pat, hi)
147
- case null => false
+ tryConstrainSimplePatternType(pat, hi)
+ case null => true
148
}
149
- case _ => false
+ case _ => true
150
151
152
def trySuperType =
@@ -159,7 +159,7 @@ trait PatternTypeConstrainer { self: TypeComparer =>
159
tryConstrainSimplePatternType(pat, upcasted) || constrainUpcasted(upcasted)
160
else true
161
162
- tryGadtBounds || trySuperType
+ tryGadtBounds && trySuperType
163
164
165
0 commit comments