<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">As a side note, some people want inline enum types with exact syntax of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">A|B</code>.<br>The difference is that in this case the chosen side of inline enum is always meaningful. That is, if <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">S:A&B</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">x:S</code>, then <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">.0(x) as A|B</code> ≠ <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">.1(x) as A|B</code><br>I guess, the version suggested by TS reflects what Chris considered harmful. Those inline enums may be more feasible.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj5BcyBhIHNp
ZGUgbm90ZSwgc29tZSBwZW9wbGUgd2FudCBpbmxpbmUgZW51bSB0eXBlcyB3aXRoIGV4YWN0IHN5
bnRheCBvZiBgQXxCYC48L2Rpdj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+VGhlIGRpZmZlcmVu
Y2UgaXMgdGhhdCBpbiB0aGlzIGNhc2UgdGhlIGNob3NlbiBzaWRlIG9mIGlubGluZSBlbnVtIGlz
IGFsd2F5cyBtZWFuaW5nZnVsLiBUaGF0IGlzLCBpZiBgUzpBJmFtcDtCYCBhbmQgYHg6U2AsIHRo
ZW4gYC4wKHgpIGFzIEF8QmAgJm5ic3A74omgJm5ic3A7IGAuMSh4KSBhcyBBfEJgPC9kaXY+PGRp
diBjbGFzcz0iZ21haWxfcXVvdGUiPkkgZ3Vlc3MsIHRoZSB2ZXJzaW9uIHN1Z2dlc3RlZCBieSBU
UyByZWZsZWN0cyB3aGF0IENocmlzIGNvbnNpZGVyZWQgaGFybWZ1bC4gVGhvc2UgaW5saW5lIGVu
dW1zIG1heSBiZSBtb3JlIGZlYXNpYmxlLjwvZGl2PjwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div>