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
Scala's subsumption can't be controlled #7857
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7857?orig=1 |
@retronym said: Please don't raise bugs on the language like this without some sort of consensus from scala-language and/or scala-internals. I can't work in this issue tracker otherwise. It's not a venue for discussion or wishlists, but rather a (already long) list of things that we can action. |
Shelby Moore III (shelby) said: https://groups.google.com/forum/#!topic/scala-language/B6f-iubR9Mk I've been accepting feedback on this for 2 years at SO, and no one has offered a solution. Okay perhaps I jumped the gun, let's see what others say at scala-language. Apologies if I end up being wrong on this one. Even if I am correct, I accept your point. Will do. I got impatient on this one and want to just file it while it is fresh in mind. Two years is a long time. Yet I get your point about proper vetting procedure. |
Shelby Moore III (shelby) said: |
@retronym said: |
After two years of deliberations, I have come to the conclusion that the inability to tell Scala's subsumption not to subsume the input type parameter on methods of covariant types can not be worked around in any way.
And it prevents correct implementation of certain features which also can not be worked around in any other way. I really wanted to mark this as a bug, instead of an improvement, because it blocks essential functionality that can not be achieved any other way. Feel free to change it to a bug if you agree with me. It is said that if a type system can't correctly type the "contains problem" then it is not worth going through the effort to enforce types at all at compile-time. Refer to the following links for the proof and example use cases which support this.
http://stackoverflow.com/questions/8360413/selectively-disable-subsumption-in-scala-correctly-type-list-contains
Note it is not just contains which is affected yet it is the ability to correct type anything that is an input to a covariant type:
https://groups.google.com/d/msg/scala-debate/LWBz3-Q0pNI/rWG4hImvCQgJ
https://groups.google.com/d/msg/scala-language/lChLcLES_Dk/b78ywjsHcbMJ
The text was updated successfully, but these errors were encountered: