Skip to content

Exhaustivity warnings not applied to code passed to inline method #20372

Closed
@mrdziuban

Description

@mrdziuban

Compiler version

3.4.1, 3.4.2-RC1, and the latest nightly 3.5.0-RC1-bin-20240508-b10d64e-NIGHTLY

Minimized code

https://scastie.scala-lang.org/mrdziuban/wkGp5WuMSRuo9JNPKQhLjg/2

sealed trait Foo
case object Bar extends Foo
case object Baz extends Foo

inline def id[A](a: A): A = a

def doesNotHaveWarning(foo: Foo) =
  id(foo match {
    case Bar => "Bar"
  })

Output

None, expected a warning on the match in def doesNotHaveWarning

Expectation

The compiler should report an exhaustivity warning in def doesNotHaveWarning for the missing case Baz

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions