<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Hi Olexandr,<br>
    <br>
    I will take a look at this issue, in the meantime as Maurizio
    commented if you don't specify the permits clause the compiler
    should be able to infer it for you,<br>
    <br>
    Thanks,<br>
    Vicente<br>
    <br>
    <div class="moz-cite-prefix">On 8/26/24 10:09, Olexandr Rotan wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAL5bRt945H8ry+WCjiAA18Zxbfq3XCVxCR=7dXOvWGMgpSK=1Q@mail.gmail.com">
      
      <div dir="ltr">So there is a special case for permits clause, but
        what about extends clause? Should I also look into it, or,
        formally, this is a different issue that requires (arguably) JLS
        change?</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, Aug 26, 2024 at
          4:51 PM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com" moz-do-not-send="true" class="moz-txt-link-freetext">maurizio.cimadamore@oracle.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p><br>
            </p>
            <div>On 26/08/2024 14:44, Maurizio Cimadamore wrote:<br>
            </div>
            <blockquote type="cite">That is, an “extends” or “permits”
              clause is not really type-checked as if inside the body of
              class C. This results in the accessibility problem you
              point out (which might or might not be a compiler glitch,
              I don’t think the JLS is crystal clear on how Tmp.A should
              be checked).</blockquote>
            <p>I stand corrected - see JLS 6.6:</p>
            <p> </p>
            <blockquote type="cite">A member (class, interface, field,
              or method) of a class, interface, type parameter, or
              reference type, or a constructor of a class, is accessible
              only if (i) the class, interface, type parameter, or
              reference type is accessible, and (ii) the member or
              constructor is declared to permit access: <br>
              [...]<br>
              <div>
                <ul style="list-style-type:circle">
                  <li>
                    <p> Otherwise, the member or constructor is declared
                      <code>private</code>. Access is permitted only
                      when one of the following is true: </p>
                    <div>
                      <ul style="list-style-type:square">
                        <li>
                          <p>Access occurs from within the body of the
                            top level class or interface that encloses
                            the declaration of the member or
                            constructor. </p>
                        </li>
                        <li> Access occurs in the <code>permits</code>
                          clause of the top level class or interface
                          that encloses the declaration of the member. </li>
                        <li>
                          <p>Access occurs in the record component list
                            of the top level record class that encloses
                            the declaration of the member. </p>
                        </li>
                      </ul>
                    </div>
                  </li>
                </ul>
              </div>
            </blockquote>
            So, there's special accessibility pleads for "permits"
            clauses. So yes, this is a javac bug.
            <p>I've added some comments to JDK-8338981.</p>
            <p>Maurizio<br>
            </p>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>