Skip to content

False positive of "Unreachable case" warning under macro type match #18507

Closed
@soronpo

Description

@soronpo

Compiler version

Fails on 3.3.1-RC7
Fails on latest nightly (3.4.0-RC1-bin-20230901-89e8dba-NIGHTLY)
Last good release: 3.3.1-RC1-bin-20230301-0df5ae2-NIGHTLY
First bad release: 3.3.1-RC1-bin-20230302-8020c77-NIGHTLY
First bad commit: 6b36cd9

Minimized code

//> using options -Xfatal-warnings
import scala.quoted.*

trait DFValOf[T]

def calcWidth(x: List[Type[Any]])(using Quotes): Unit =
  x.collect { case '[DFValOf[t]] => ???}

Output

7 |  x.collect { case '[DFValOf[t]] => ???}
  |                   ^^^^^^^^^^^^^
  |                   Unreachable case

Expectation

No warning (no error under fatal-warnings).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions