RFR: 5059679: name clash not reported for interface inheritance
Archie Cobbs
archie.cobbs at gmail.com
Thu Feb 9 22:49:08 UTC 2023
On Thu, Feb 9, 2023 at 3:59 PM Remi Forax <forax at univ-mlv.fr> wrote:
> > public class NarrowingNameClash {
> >
> > public interface Upper<T> {
> > void method(T param);
> > }
> >
> > public interface Lower<R> extends Upper<Class<R>> {
> > void method(Class<?> param); // erasure name clash here
> > }
> > }
> >
> > This violates §8.4.8.3 because `method(Class<R>)` and `method(Class<?>)`
> have
> > the same erasure. However, the compiler is not reporting an error in
> this case.
> >
> > Here's my understanding of the bug... (reviewer please double-check this
> :)
>
> It's maybe a spec bug because you can still have a raw class that
> implement both interfaces.
>
Apologies... I'm not completely getting what you're saying.
The point here is that "NarrowingNameClash" itself should not compile,
so... ?
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230209/669903b0/attachment.htm>
More information about the compiler-dev
mailing list