<div dir="ltr">Hello,<br><div>I am currently looking into reimplementing core reflection's signature parsing to be based off the new Class-file API.</div><div><br></div><div>One thing I noticed when using Signature.TypeArg is that it is a perfect candidate for algebraic data type, like:</div><div>TypeArg</div><div>  - Unbounded: a singleton ENUM</div><div>  - Bounded: has 2 fields: 3-way wildcard indicator (+-and none), a RefTypeSig</div><div><br></div><div>Alternatively, Bounded can be split into 3 classes that each hold a RefTypeSig instead of using the 3-way indicator, for the ref type sig is not really interchangeable. </div><div><br></div><div>This model's main advantage is that users can be assured that they can just obtain RefTypeSig if the TypeArg is bounded, without having to write dubious Optional.get()/orElseThrow() in user code.</div><div><br></div><div>Best,</div><div>Chen Liang</div></div>