<div dir="ltr"><div>Hello,</div><div><br></div><div>I've been looking for information on how tagged unions will pan out in valhalla.</div><div><br></div><div>A tagged union in java would be something like</div><div><br></div><div>```</div><div>public sealed abstract value class Shape permits Circle, Square {}</div><div><br></div><div>public value class Circle extends Shape {</div><div>  public float radius;</div><div>}</div><div><br></div><div>public value class Square extends Shape {</div><div>  public float side;</div><div>}</div><div>```</div><div>(adapted from <a href="https://docs.oracle.com/en/java/javase/17/language/sealed-classes-and-interfaces.html">https://docs.oracle.com/en/java/javase/17/language/sealed-classes-and-interfaces.html</a>)</div><div><br></div><div>From what I know currently, this wouldn't end up being scalarized or flattened, even though the JVM runtime knows that only Circle and Square can extend Shape.</div><div>Is there a future where these do end up getting flattened or scalarized? </div></div>