Skip to content

Missing relevance check for select in patterns #3812

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
liufengyun opened this issue Jan 11, 2018 · 1 comment
Closed

Missing relevance check for select in patterns #3812

liufengyun opened this issue Jan 11, 2018 · 1 comment

Comments

@liufengyun
Copy link
Contributor

Arguably, all of them should be invalid.

    val x = 42
    val Y = "h"

    x match { case { "h" }.toString => println(42) }  // ok
    x match { case { "h".toString } => println(42) }  // error
    x match { case Y => println(42) }  // error
    x match { case Y.toString => println(42) }  // ok
@allanrenucci
Copy link
Contributor

As pointed out in #3810, even though some of these patterns compile, they do not pass Ycheck

allanrenucci added a commit to dotty-staging/dotty that referenced this issue Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants