<div dir="ltr"><div dir="ltr">On Wed, Feb 15, 2023 at 11:16 AM Ron Pressler <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</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"><br>
<div style="overflow-wrap: break-word;"><div><blockquote type="cite">The implicit class idea scares me a bit. One issue is that it could turn invalid code into "working" code inadvertently.<div><div dir="ltr">
</div>
</div>
</blockquote>
<div><br>
</div>
<div>It’s a compile-time error for an implicit class to be a member of a named package. So if a “top-level” method is defined in a compilation unit that’s in a named package, that will be an error. Additionally, an implicit class must have a main method, and
an implicit class cannot be directly referenced by name.</div>
<div><br>
</div>
<div>Do you think that’s not enough protection?</div></div></div></blockquote><div><br></div><div>Yes - that helps a lot. I would mainly worry about "production" environments, where the unnamed package is unlikely to be in use.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">Is there a good reason why implicit class support should NOT be restricted to JEP 330 mode only?</div>
</div>
</div>
</blockquote>
<br>
</div>
<div>Implicit classes are a language feature, while JEP 330 is a JDK implementation detail. Restricting implicit classes to source-code launching would introduce both a beginners’ dialect and a beginners’ toolchain, violating two of the JEPs stated anti-goals.
The reason they are anti-goals is because they run counter to the goal of gradually growing the program (they would require switching dialect once you want a proper build). The proposed way is both orthogonal, and so easier to specify, and supports the goal
of gradual growth.
</div></div>
</blockquote></div><div><br></div><div>Makes sense - thanks for clarifying.<br></div><div><br></div><div>-Archie<br></div><br>-- <br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>