Hi,<div><br></div><div>I am confused by a compile error generated by the following code:</div><div><br></div><div><div>sealed interface I<T> {}</div><div>record A<T>(T t) implements I<T> {}</div><div>public static void main(I<String> args) {</div><div>  switch (args) {</div><div>    case A<String>(var x) -> System.out.println(x);</div><div>  }</div><div>}</div></div><div><br></div><div>Compiling the code with the following JDK:</div><div><br></div><div><div>openjdk 19 2022-09-20</div><div>OpenJDK Runtime Environment (build 19+37)</div><div>OpenJDK 64-Bit Server VM (build 19+37, mixed mode, sharing)</div></div><div><br></div><div>I get:</div><div><br></div><div><div>.\JavaBug.java:5: error: the switch statement does not cover all possible input values</div><div>    switch (args) {</div><div>    ^</div><div>Note: .\JavaBug.java uses preview features of Java SE 19.</div><div>Note: Recompile with -Xlint:preview for details.</div><div>1 error</div></div><div><br></div><div>What cases could be not covered? It looks like a bug to me.</div><div><br></div><div>Also, I believe that showing the particular uncovered cases in the error messages would make very good developer experiences.</div><div><br></div><div>Best regards,</div><div>Tesla</div><div><br></div>