-<span class=grvsc-line><span class=grvsc-source><span class=mtk1>}</span></span></span></code></pre><article class="is-info message"><div class=message-body><div><p>Indepently of the option you choose, the compiler will warn you if you handle an invalid case.</div></div></article><p>If you want the TypeScript compiler to warn you when you don't handle all cases, you can use the common hack of adding a <code>default</code> case that stores the value in a variable of type <code>never</code>.<pre class="atom-one-light grvsc-container"data-index=8 data-language=ts><code class=grvsc-code><span class=grvsc-line><span class=grvsc-source><span class=mtk14>function</span><span class=mtk1> </span><span class=mtk9>execute</span><span class=mtk1>(command </span><span class=mtk8>:</span><span class=mtk1> </span><span class=mtk4>Command_$union</span><span class=mtk1>) {</span></span></span>
0 commit comments