Lets take a look at this example. First i create enum
enum myEnum {
a = 'a',
b = 'b'
}
now i make similar enum but I add one more numeric ! ( this is important) value
enum myExtendedEnum {
a = "a",
b = "b",
//this can be any number
c = 11,
}
now look at this.
const returnsMyEnum = function() : myEnum {
return 48;
}
const returnMyExtendedEnum = function() : extendedEnum {
return 48;
}
Guess which one of above function are buggy for typescript? I would expect both but nope, only the returnsMyEnum one. Do you understand whats happen here or i should rather open bug report in typescript repository?