Skip to content

Changes from 3.4.0 breaks match exhaustive checking of a macros #22212

Closed
@HollandDM

Description

@HollandDM

Compiler version

Airstream released v17.2.0, which introduce a macro that help users to "split" signal of a ADT into signal of its children.
This macros re-arranges case blocks and create a match expr out of it, there for leverages the compiler's exhaustive checking.
It works on 3.3.4, but stop working on >=3.4.0

Minimized code (required Airstream v17.2.0)

import com.raquo.laminar.api.L.*

object Main {

  sealed abstract class Page {}

  sealed abstract class ToolPage extends Page {}

  case object CompilePage extends ToolPage {}

  case object AsmEmulatePage extends ToolPage {}

  case object BugHuntersPage extends Page {}

  def testSignal(pageSignal: Signal[ToolPage]): Unit = {
    pageSignal
      .splitMatchOne
      .handleValue(CompilePage)(())
      .toSignal
  }

  def main(args: Array[String]): Unit = ()

}

Expectation

on scala 3.3.4 LTS, compiler will warn "match may not exhaustive".
it should remains so on >=3.4

UPDATED: further checking yields the following results:
3.3.4 works, 3.4.0 doesn't, 3.5.0 doesn't, 3.5.1 works, 3.5.2 works, 3.6.2 doesn't

Metadata

Metadata

Assignees

Labels

area:inlinearea:metaprogramming:otherIssues tied to metaprogramming/macros not covered by the other labels.area:reportingError reporting including formatting, implicit suggestions, etcarea:scala.jsitype:bugregressionThis worked in a previous version but doesn't anymorestat:needs bisectionNeed to use nightly builds and git bisect to find out the commit where this issue was introduced

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions