On Wed, Oct 15, 2025 at 7:10 PM Archie Cobbs <[email protected]> wrote:
> On Wed, Oct 15, 2025 at 11:34 AM Manu Sridharan <[email protected]> > wrote: > >> This is all mostly possible via the Checker Framework and similar >> approaches. >> > > In the spirit of due diligence, I am attempting to implement something > like "WHAT I WANT" using the checker framework > Just a little follow-up on this "due diligence" project... (a summary of the idea is here <https://archiecobbs.github.io/typetags/site/apidocs/org/dellroad/typetags/core/TypeTag.html> ). I'm declaring defeat for now due to an insufficient product of ability×time. A few debrief notes... 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 broken <https://github.com/typetools/checker-framework/issues/7388>. Unfortunately I don't have time to figure that part out on my own. 2. Thanks to the ClassFile API, the runtime checking component of this idea was fairly fun & easy to prototype (working example here <https://github.com/archiecobbs/typetags/blob/main/example/src/main/java/org/dellroad/typetags/example/Example.java> ). 3. There are still a few holes in the RuntimeVisibleTypeAnnotations class file attribute representation of uses of type annotations in Java source, e.g., JDK-8371735 <https://bugs.openjdk.org/browse/JDK-8371735> and JDK-8371733 <https://bugs.openjdk.org/browse/JDK-8371733>. These make me wonder whether anyone is actually using these attributes much in the real world. So for now, this dream of simple, custom type restrictions is still, um, available :) -Archie -- Archie L. Cobbs
