Skip to content

Document irrefutable unapply in pattern matching #6490

Closed
@smarter

Description

@smarter

Unapply that return Some[X] or true are statically known to always match, and the exhaustiveness checker uses this knowledge (see https://github.com/lampepfl/dotty/blob/494f9e6c2a397ab47a08d16d09d64c88c4a0ee82/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala#L285-L294). This should be documented in http://dotty.epfl.ch/docs/reference/changed-features/pattern-matching.html

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions