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
If first specialized type is not primitive, the second is ignored. #3575
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3575?orig=1 |
@rossjudson said: solo.Two |
@dragos said: |
@adriaanm said: rewrote accessibility in overriding checks so they're more readable, but hopefully with same semantics review by odersky |
@non said: But it seems that AnyRef specialization isn't working properly in this case at least. I see synthetic classes like Two$mcLI$sp being generated but not used. This may actually be a recently introduced bug breaking @SPEC(AnyRef) though; in which case, this bug might actually be fixed. |
@non said (edited on Feb 17, 2012 11:38:44 PM UTC): There's another bug, which is that as things stand [@specialized A] creates AnyRef specializations, but fails to use them. I'll look in this more closely. |
@non said: |
@non said: |
@magarciaEPFL said: Now the specialized version is constructed in each case (ie the bug is fixed, closing it):
|
I am not sure if this is a bug. The code runs fine. Given:
In the first two cases the non-specialized version of Two is constructed. I expect the first println to show that the choice of a specialized version, for the second parameter (it is not). I expect the generic version to be chosen for the second (it is). I expect the specialized version to be chosen for the third (it is).
It's not clear to me whether this behavior is in the spec or not -- must all type parameters annotated with @specialized be primitive, in order for a primitive to be selected? Or is the mixture of object and primitive just not covered?
Apologies if this is covered somewhere already in the spec.
The text was updated successfully, but these errors were encountered: