-
Notifications
You must be signed in to change notification settings - Fork 21
Unexpected behavior for inner case class pattern matching #9639
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
Imported From: https://issues.scala-lang.org/browse/SI-9639?orig=1 |
@adriaanm said (edited on Feb 1, 2016 6:20:24 PM UTC): |
@adriaanm said: |
This progressed in 2.12. Thanks, Jason. |
I have noticed some unexpected behavior related to inner case class pattern matching. Assume an outer class named Outer and an inner case class named Inner. The generic type of this inner class (e.g. not bound to a particular Outer instance) is Outer#Inner.
Pattern matching on the Inner class works as expected when feeding values of kind Any, while pattern matching on values of kind Outer#Inner does not. More precicely, inner objects belonging to different outer instances are matched successfully, which is unexpected.
The following code illustrates the problem:
See discussion on scala-internals group.
The text was updated successfully, but these errors were encountered: