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
Byte conforms to Char when comes from public static final field in Java #8338
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8338?orig=1 |
@adriaanm said (edited on Mar 3, 2014 6:26:37 PM UTC):
|
@Alefas said: |
@adriaanm said (edited on Mar 4, 2014 5:26:30 PM UTC): |
@paulp said: Nothing widens to Char. It's a bug. |
@adriaanm said: |
@paulp said: public static final byte z1 = 123;
public static final short z2 = 123;
public static final char z3 = 123;
public static final int z4 = 123;
public static final long z5 = 123;
public static final byte z6 = -123; Why stop at 5? Squeeze the long in too, that 123 is just as 123 as the other 123s. It's funny to think that one could change a static final java int from 127 to 128, and this would break the scala code which makes use of it, and it would all be by design. I hope things keep getting weirder. |
Java code:
Scala code:
Scala code shouldn't compile. Moreover in case of static method in Java code won't compile.
The text was updated successfully, but these errors were encountered: