You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enum myEnum {
a = 'a',
b = 'b',
}
enum extendedEnum {
a = "a",
b = "b",
//use any number here, 11 is random value
c = 11,
}
//use any number here, 48 is random value
const returnsMyEnum = function() : myEnum {
return 48;
}
const returnMyExtendedEnum = function() : extendedEnum {
return 48;
}
π Actual behavior
Only returnsMyEnum gives typescript error.
π Expected behavior
Both functions are wrong.
The text was updated successfully, but these errors were encountered:
π Search Terms
wrong enum behaviour
numeric enum wrong check
inconsistent enum behaviour
π Version & Regression Information
I see it in all versions of ts
β― Playground Link
https://tsplay.dev/N9PO8w
π» Code
π Actual behavior
Only
returnsMyEnum
gives typescript error.π Expected behavior
Both functions are wrong.
The text was updated successfully, but these errors were encountered: