RFR: 7039014: Confusing error message for method conflict [v3]
Archie L. Cobbs
duke at openjdk.org
Wed Oct 19 15:22:51 UTC 2022
> 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:
Remove obsolete @author tags and combine tests into one file.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10752/files
- new: https://git.openjdk.org/jdk/pull/10752/files/4404568c..34957acb
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10752&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10752&range=01-02
Stats: 125 lines in 7 files changed: 42 ins; 83 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/10752.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10752/head:pull/10752
PR: https://git.openjdk.org/jdk/pull/10752
More information about the compiler-dev
mailing list