<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Archie Cobbs" <archie.cobbs@gmail.com><br><b>To: </b>"Remi Forax" <forax@univ-mlv.fr><br><b>Cc: </b>"Archie L. Cobbs" <duke@openjdk.org>, "compiler-dev" <compiler-dev@openjdk.org><br><b>Sent: </b>Thursday, February 9, 2023 11:49:08 PM<br><b>Subject: </b>Re: RFR: 5059679: name clash not reported for interface inheritance<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div dir="ltr">On Thu, Feb 9, 2023 at 3:59 PM Remi Forax <<a href="mailto:forax@univ-mlv.fr" target="_blank">forax@univ-mlv.fr</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> public class NarrowingNameClash {<br>
> <br>
>    public interface Upper<T> {<br>
>        void method(T param);<br>
>    }<br>
> <br>
>    public interface Lower<R> extends Upper<Class<R>> {<br>
>        void method(Class<?> param);        // erasure name clash here<br>
>    }<br>
> }<br>
> <br>
> This violates §8.4.8.3 because `method(Class<R>)` and `method(Class<?>)` have<br>
> the same erasure. However, the compiler is not reporting an error in this case.<br>
> <br>
> Here's my understanding of the bug... (reviewer please double-check this :)<br>
<br>
It's maybe a spec bug because you can still have a raw class that implement both interfaces.<br></blockquote><br>Apologies... I'm not completely getting what you're saying.</div><br><div class="gmail_quote">The point here is that "NarrowingNameClash" itself should not compile, so... ?</div></div></blockquote><div><br></div><div>The idea is that an interface should not compile only if all possible classes that implements that interface, here Lower will not compile,<br data-mce-bogus="1"></div><div>so the compiler can report the issue earlier when Lower is declared.<br data-mce-bogus="1"></div><div>But here, there is at least one class that implements Lower and compiles.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><br><div class="gmail_quote">-Archie</div></div></blockquote><div><br></div>Rémi<div><br></div></div></div></body></html>