Skip to content

Spurious exhaustivity warning #8203

Closed
@Jasper-M

Description

@Jasper-M

minimized code

Behold my beautiful enum.

sealed trait Pretty { self: Color => }      
sealed trait Dull { self: Color => }
enum Color  {
  case Pink extends Color with Pretty
  case Red extends Color with Dull
}

def describe(c: Color) = c match { 
  case Color.Pink => "Amazing!"
  case Color.Red => "Yawn..." 
}

Compilation output

8 |def describe(c: Color) = c match { 
  |                         ^
  |                         match may not be exhaustive.
  |
  |                         It would fail on pattern case: _: Color

expectation

No warning.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions