Skip to content

-optimise changes the position of some pattern matching errors #3805

Closed
@smarter

Description

@smarter

This affects everything in https://github.com/lampepfl/dotty/tree/master/tests/neg-no-optimise:

% dotc tests/neg-no-optimise/patmat1.scala
-- Error: tests/neg-no-optimise/patmat1.scala:21:11 ----------------------------
21 |      case D() =>  // error: neither a subtype not a supertype
   |           ^
   |        this case is unreachable since class C and class D are unrelated
one error found
% dotc -optimise tests/neg-no-optimise/patmat1.scala
-- Error: tests/neg-no-optimise/patmat1.scala:18:4 -----------------------------
18 |    cc match {
   |    ^^
   |    this case is unreachable since class C and class D are unrelated
one error found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions