-
Notifications
You must be signed in to change notification settings - Fork 21
allow more precise type when matching parametric case classes (or extractors) #8901
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-8901?orig=1 |
@milessabin said: |
@paulp said: I believe the code is unusually clear and shouldn't be difficult for someone with higher optimism to adapt into a scala PR. |
@milessabin said: |
@paulp said: |
someone want to check if this is still reproducible in current Scala 2 and/or 3? |
Currently it is possible to match a parametric case class with correct type like so:
What does not work is the same while extracting values (1):
When not including the name for the type, T is inferred to be Any (2):
There are two things which should be done:
The second part’s current negative effect can be seen in the following (assuming generic
ActorRef[-T]
which only accepts messages of type T):The text was updated successfully, but these errors were encountered: