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
// Outer enumenumEnum{a=1,b,c};functionfoo(): number{// Inner enum with the same nameenumEnum{// Initialize this using the value of// the outer enum, which is 1a=Enum.a};// This should return a number, but it's undefined! :oreturnEnum.a;}
Expected behavior:
TypeScript should resolve the outer Enum definition and inline the Enum.a like it would with non-shadowed values.
Actual behavior:
TypeScript does not inline the value so Enum.a is evaluated (to undefined) resulting in a mismatch between the reported type and the runtime value.