RFR: 7039014: Confusing error message for method conflict [v2]
Vicente Romero
vromero at openjdk.org
Wed Oct 19 04:30:10 UTC 2022
On Wed, 19 Oct 2022 02:08:55 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:
>> This fixes a confusing error message.
>>
>> Currently, this input:
>>
>> interface A<T> {
>> byte m(String x);
>> char m(T x);
>> }
>>
>> interface B extends A<String> {
>> }
>>
>> produces this error:
>>
>> A.java:6: error: types A<String> and A<String> are incompatible;
>> interface B extends A<String> {
>> ^
>> both define m(String), but with unrelated return types
>> 1 error
>>
>> This patch detects when the two types are actually the same type and gives this error message instead:
>>
>> A.java:6: error: type A<String> defines m(String) more than once with unrelated return types
>> interface B extends A<String> {
>> ^
>> 1 error
>
> Archie L. Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>
> Add a few more unit tests.
test/langtools/tools/javac/Diagnostics/7039014/T7039014a.java line 9:
> 7: * @compile/fail/ref=T7039014a.out -XDrawDiagnostics T7039014a.java
> 8: */
> 9: public class T7039014a {
I think that T7039014(a,b,c) should be combined into only one test
-------------
PR: https://git.openjdk.org/jdk/pull/10752
More information about the compiler-dev
mailing list