<div dir="ltr">Admittedly my first thought about folding primitive type conversions into patterns was, "Oh no," but then seeing the deep symmetry drawn with casts was pretty compelling.<div><br></div><div>I wonder if I am correct to assume that this symmetry would also inform how transitive relationships are handled? For instance, I can use a series of conversions to transform an Integer to a short:<br><br>    Integer x = 3;</div><div>    int y = x;</div><div>    short z = (short) y;</div><div><br></div><div>From symmetry, I'd assume that I would not be able to "destructure an Integer to a short" directly, and would instead have to use a symmetric series of patterns:<br><br>    x instanceof int y && y instanceof short z</div><div><br></div><div>Bonus question... Would it be legal/equivalent to express this as:<br><br>    x instanceof Integer y && y instanceof short z<br><br>It is not symmetric with casting, but since null is excluded, it seems that for destructuring purposes Integer and int share the same set of possible values.</div><div><br></div><div>- Daniel Avery</div></div>