<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div><div style="font-size: 16px; background-color: rgb(255, 255, 255);">hi, valhalla developers.</div><div style="font-size: 16px; background-color: rgb(255, 255, 255);">Can we use static final value class as switch label? since primitive types support this.</div><div style="font-size: 16px; background-color: rgb(255, 255, 255);">for example:<span class="mce-nbsp-wrap" contenteditable="false">   </span></div><div style="font-size: 16px; background-color: rgb(255, 255, 255);"><div style="background-color: rgb(43, 43, 43); color: rgb(169, 183, 198);"><pre style="font-family: "JetBrains Mono", monospace; font-size: 9.8pt;"><span style="color: rgb(20, 210, 233);">public static </span>value <span style="color: rgb(20, 210, 233);">class </span><span style="color: rgb(0, 153, 255);">UInt32 </span>{<br>    <span style="color: rgb(20, 210, 233);">int </span><span style="color: rgb(255, 86, 184);">value</span><span style="color: rgb(156, 203, 242);">;<br></span><span style="color: rgb(156, 203, 242);"><br></span><span style="color: rgb(156, 203, 242);">    </span><span style="color: rgb(20, 210, 233);">public </span><span style="color: rgb(0, 143, 237);">UInt32</span>(<span style="color: rgb(20, 210, 233);">int </span><span style="color: rgb(255, 135, 41);">value</span>) {<br>        <span style="color: rgb(20, 210, 233);">this</span>.<span style="color: rgb(255, 86, 184);">value </span><span style="color: rgb(0, 255, 138);">= </span><span style="color: rgb(255, 135, 41);">value</span><span style="color: rgb(156, 203, 242);">;<br></span><span style="color: rgb(156, 203, 242);">    </span>}<br>    <span style="color: rgb(20, 210, 233);">public static final </span><span style="color: rgb(0, 153, 255);">UInt32 </span><span style="color: rgb(231, 231, 101); font-style: italic;">ZERO </span><span style="color: rgb(0, 255, 138);">= </span><span style="color: rgb(20, 210, 233);">new </span>UInt32(<span style="color: rgb(255, 86, 184);">0</span>)<span style="color: rgb(156, 203, 242);">;<br></span>}</pre></div><span data-mce-type="bookmark" id="mce_2_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow: hidden; line-height: 0px;"></span><div style="background-color: rgb(43, 43, 43); color: rgb(169, 183, 198);"><pre style="font-family: "JetBrains Mono", monospace; font-size: 9.8pt;"><span style="color: rgb(20, 210, 233);">switch </span>(<span style="color: rgb(20, 210, 233);">new </span>UInt32(<span style="color: rgb(255, 86, 184);">1</span>)) {<br>    <span style="color: rgb(20, 210, 233);">case </span><span style="color: rgb(0, 153, 255);">UInt32</span>.<span style="color: rgb(231, 231, 101); font-style: italic;">ZERO </span>-> {<br>        <span style="color: rgb(0, 153, 255);">System</span>.<span style="color: rgb(231, 231, 101); font-style: italic;">out</span>.println(<span style="color: rgb(186, 147, 0);">"zero"</span>)<span style="color: rgb(156, 203, 242);">;<br></span><span style="color: rgb(156, 203, 242);">    </span>}<br>    <span style="color: rgb(20, 210, 233);">default </span>-> {}<br>}</pre></div>javac gives me: error: pattern or enum constant required<span data-mce-type="bookmark" id="mce_3_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow: hidden; line-height: 0px;"></span></div><div style="font-size: 16px; background-color: rgb(255, 255, 255);">thanks</div><div style="font-size: 16px; background-color: rgb(255, 255, 255);">snownf.</div></div><div><!--emptysign--></div>