Integrated: 7039014: Confusing error message for method conflict

Archie L. Cobbs duke at openjdk.org
Thu Oct 20 14:01:16 UTC 2022


On Tue, 18 Oct 2022 21:43:10 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

This pull request has now been integrated.

Changeset: 9b971626
Author:    Archie L. Cobbs <archie.cobbs at gmail.com>
Committer: Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/9b971626f79b4f64442cf6888c2b6114c9a06351
Stats:     86 lines in 6 files changed: 83 ins; 0 del; 3 mod

7039014: Confusing error message for method conflict

Reviewed-by: vromero

-------------

PR: https://git.openjdk.org/jdk/pull/10752


More information about the compiler-dev mailing list