Closed
Description
Compiler version
Both:
- 3.0.0-RC1
- 3.0.1-RC1-bin-20210402-775d881-NIGHTLY
Minimized code
import scala.quoted.*
def qwe(using Quotes) = {
import quotes.reflect.*
def ko_1(param: ValDef | TypeDef) =
param match {
case _: ValDef =>
case _: TypeDef =>
}
def ko_2(params: List[ValDef] | List[TypeDef]) =
params.map {
case x: ValDef =>
case y: TypeDef =>
}
}
Output
[warn] -- [E029] Pattern Match Exhaustivity Warning: /home/golly/scala3bug/sbt/src/main/scala/asd.scala:7:4
[warn] 7 | param match {
[warn] | ^^^^^
[warn] | match may not be exhaustive.
[warn] |
[warn] | It would fail on pattern case: _: ValDef, _: TypeDef
[warn] -- [E029] Pattern Match Exhaustivity Warning: /home/golly/scala3bug/sbt/src/main/scala/asd.scala:14:6
[warn] 14 | case x: ValDef =>
[warn] | ^
[warn] | match may not be exhaustive.
[warn] |
[warn] | It would fail on pattern case: _: ValDef, _: TypeDef
[warn] two warnings found
Expectation
No warnings.