Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smarter opened this issue Jan 11, 2018 · 1 comment
Closed

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

smarter opened this issue Jan 11, 2018 · 1 comment

Comments

@smarter
Copy link
Member

smarter commented Jan 11, 2018

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
smarter added a commit to dotty-staging/dotty that referenced this issue Jan 11, 2018
I don't think the `def run` in the original testcase should work given
that the added `def run2` doesn't in either scalac or dotty.

The testcase is in neg-no-optimise because of scala#3805.
@allanrenucci
Copy link
Contributor

Closing as we removed the optimisations in #4799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants