issue with fix for JDK-8064464
Liam Miller-Cushon
cushon at google.com
Mon Nov 24 19:37:24 UTC 2014
The fix for JDK-8064464 [1] [2] prevents the following code from compiling
(it works fine with 8u25 and 7u67). Is this deliberate?
abstract class Test {
abstract <T> T e();
abstract int f();
void m(boolean flag) {
String.valueOf(flag ? f() : this.<Integer>e());
}
}
$ javac Test.java
Test.java:5: error: reference to valueOf is ambiguous
String.valueOf(flag ? f() : this.<Integer>e());
^
both method valueOf(Object) in String and method valueOf(int) in String
match
[1] https://bugs.openjdk.java.net/browse/JDK-8064464
[2] http://hg.openjdk.java.net/jdk9/dev/langtools/rev/601e08b62ba8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20141124/53b30359/attachment.html>
More information about the compiler-dev
mailing list