<div dir="ltr"><div dir="ltr">On Thu, Feb 9, 2023 at 5:34 PM <<a href="mailto:forax@univ-mlv.fr">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"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br><hr id="m_4888470557200305683zwchr"><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From: </b>"Archie Cobbs" <<a href="mailto:archie.cobbs@gmail.com" target="_blank">archie.cobbs@gmail.com</a>><br><b>To: </b>"Remi Forax" <<a href="mailto:forax@univ-mlv.fr" target="_blank">forax@univ-mlv.fr</a>><br><b>Cc: </b>"Archie L. Cobbs" <<a href="mailto:duke@openjdk.org" target="_blank">duke@openjdk.org</a>>, "compiler-dev" <<a href="mailto:compiler-dev@openjdk.org" target="_blank">compiler-dev@openjdk.org</a>><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><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);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></div><div>so the compiler can report the issue earlier when Lower is declared.<br></div><div>But here, there is at least one class that implements Lower and compiles.<br></div></div></div></div></blockquote></div><div><br></div><div>Got it. I'm not sure what the "rule" is or if there really is one but I see your point.</div><div><br></div><div>Maybe the thinking was "If the only way to use such an interface requires using raw types then it's not worth it".<br></div><div><br></div><div>-Archie<br></div><br>-- <br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>