Version: 0.601.0.6010507 (64bit)
When you annotate a coroutine iterator to return literal types, it does not respect the literal at all and instead genericizes it. In the example below, the inferred type should still be
'foo' | 'bar' but it gets reported as
string | string (does it even make sense?)
But what’s baffling is that it is clearly aware of the literal type. In the example below, it correctly warns of an incompatibility when trying to cast the literal to a different one, and tells you the actual type of it:
So it definitely knows that it’s returning a literal, yet it does not want to show it as one?