-
Notifications
You must be signed in to change notification settings - Fork 1.1k
specifying a type in pattern matching results in a spurious warning #4674
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
Comments
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 19, 2018
It is an intended change. Since we cannot know the intent of the author, I think we should always emit a warning for fruitless type tests |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 19, 2018
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 19, 2018
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 19, 2018
nicolasstucki
added a commit
that referenced
this issue
Jun 19, 2018
Fix #4674: Do not emit waring if types are the same
janrockdev
added a commit
to janrockdev/dotty
that referenced
this issue
Jun 23, 2018
This leads to spurious warnings for compiler-generated pattern matches. I believe it's better to revert the decision and check only explicit Note the scalac does not check patterns either. |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
May 7, 2019
I believe scala#4674 had the wrong resolution. The test leads to spurious warnings for compiler-generated pattern matches. I believe it's better to revert the decision and check only explicit isInstanceOf, never patterns. Note the scalac does not check patterns either.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results in:
While it's true that I can just omit the
: Char
, the intent here was to increase readability by specifying the type. Feel free to close if this is not a bug but an intended change.The text was updated successfully, but these errors were encountered: