Closed as not planned
Description
🔎 Search Terms
Enum
🕗 Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
No response
💻 Code
const enum A {
x = 1
};
const enum B {
x = 1,
y = 1
};
🙁 Actual behavior
By using the getTypeAtLocation interface, the type of the enumeration is obtained. Enumeration B gets the enumeration type, while enumeration A gets the enumeration member type.
🙂 Expected behavior
Both Enum A and Enum B can get the enum type, not Enum A is the enum member type
Additional information about the issue
Although special logic bypass can be done through symbol.declarations, why is there a distinction in obtaining enumeration types when they are all enumeration types? Most of the time, obtaining types is to get the current type, and there is no need to directly provide the underlying type.