Skip to content

extractor error message is not clear #11118

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
He-Pin opened this issue Jan 14, 2021 · 0 comments · Fixed by #17495
Closed

extractor error message is not clear #11118

He-Pin opened this issue Jan 14, 2021 · 0 comments · Fixed by #17495
Assignees

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Jan 14, 2021

Minimized code

val (a,b) = (1,2,3)

Output

1 |val (a,b) = (1,2,3)
  |    ^
  |this case is unreachable since type (Int, Int, Int) is not a subclass of class Tuple2

and Scala2 gives:

constructor cannot be instantiated to expected type;
 found   : (T1, T2)
 required: (Int, Int, Int)

Expectation

@liufengyun liufengyun self-assigned this Jan 14, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jan 15, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jan 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jan 18, 2021
ckipp01 added a commit to ckipp01/dotty that referenced this issue May 14, 2023
This adds in a regression test showing that just like in Scala 2 a user
sees a warning about how the right hand side doesn't match the type of
the left.

closes scala#11118
nicolasstucki added a commit that referenced this issue May 15, 2023
This adds in a regression test showing that just like in Scala 2 a user
sees a warning about how the right hand side doesn't match the type of
the left.

closes #11118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants