-
Notifications
You must be signed in to change notification settings - Fork 21
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
java signature requirements lead to unsoundness in non-covariant positions #4388
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4388?orig=1 |
@odersky said: T[Char] as T<java.lang.Character> or T, which are both unsound, we should simply represent it as the raw type T. |
@paulp said:
|
@paulp said: |
@odersky said: Using raw T instead of T helps only for method results. For method arguments its an improvement only in sofar as it makes it clearer there's probably a dynamic type test going on under the covers. But it does so only if a human inspects the Java signature, and who ever does? So, I think it's really mostly a cosmetic change. I would leave it alone until 2.9 ships in any case. The current situation is OK, and the risk of changing things around now is too high. |
@SethTisue said: |
The following program compiles with no warnings, then throws a CCE when run.
In 2.8.1 it fails to compile in the desirable way, because Ordering.Char is an Ordering.
(Note that 2.8.1 requires a slightly different code because of changes to the InnerClasses attribute)
But that was changed in an attempt to fix #4214, as explained in the commit message for r24363:
Again I see no way out which does not involve generating more bridge methods which put things in boxes and take things out of other boxes.
The text was updated successfully, but these errors were encountered: