<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Wed, Oct 15, 2025 at 7:10 PM Archie Cobbs <<a href="mailto:archie.cobbs@gmail.com" target="_blank">archie.cobbs@gmail.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"><div dir="ltr"><div dir="ltr">On Wed, Oct 15, 2025 at 11:34 AM Manu Sridharan <<a href="mailto:manu@sridharan.net" target="_blank">manu@sridharan.net</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 dir="ltr">This is all mostly possible via the Checker Framework and similar approaches. </div></div></blockquote><div><br></div><div>In the spirit of due diligence, I am attempting to implement something like "WHAT I WANT" using the checker framework</div></div></div></blockquote><div><br></div><div>Just a little follow-up on this "due diligence" project... (a summary of the idea is <a href="https://archiecobbs.github.io/typetags/site/apidocs/org/dellroad/typetags/core/TypeTag.html">here</a>).</div><div><br></div><div>I'm declaring defeat for now due to an insufficient product of ability×time.</div><div><br></div><div>A few debrief notes...</div><div><br></div><div>1. I was unable to get  basic questions answered about the checker framework, for example, how to handle dynamically detected annotation types. Probably because the discussion group is <a href="https://github.com/typetools/checker-framework/issues/7388" target="_blank">broken</a>. Unfortunately I don't have time to figure that part out on my own.</div><div><br></div><div>2. Thanks to the ClassFile API, the runtime checking component of this idea was fairly fun & easy to prototype (working example <a href="https://github.com/archiecobbs/typetags/blob/main/example/src/main/java/org/dellroad/typetags/example/Example.java" target="_blank">here</a>).</div><div><br></div><div>3. There are still a few holes in the <span style="font-family:monospace">RuntimeVisibleTypeAnnotations</span> class file attribute representation of uses of type annotations in Java source, e.g., <a href="https://bugs.openjdk.org/browse/JDK-8371735" target="_blank">JDK-8371735</a> and <a href="https://bugs.openjdk.org/browse/JDK-8371733" target="_blank">JDK-8371733</a>. These make me wonder whether anyone is actually using these attributes much in the real world.</div><div><br></div><div>So for now, this dream of simple, custom type restrictions is still, um, available :)</div><div><br></div><div>-Archie</div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>
</div>
</div>