Yeah, kind of, the problem with enums from what I understood from the current RFCs is that you'll need extra code to map a scalar to that specific enum value.
Besides that, a literal type implementation is afaik simpler to implement/spec than enums, thus having a better chance to pass voting. On Mon, Oct 5, 2020 at 2:56 AM Max Semenik <maxsem.w...@gmail.com> wrote: > пн, 5 окт. 2020 г., 02:38 Bogdan Ungureanu <bogdanungurean...@gmail.com>: > >> >> function getStatus(): "draft" | "published" { } >> > > It sounds that what you're really asking for is enums, e.g. > > enum Status { > Draft, > Published > }; > > function getStatus(): Status { ... } > >>