-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler API: A reference to an enum with one value references the enum value #46755
Comments
Not familiar with the compiler codebase, but my guess is this happens because an enum type is equivalent to the union of its members, similar to how |
That鈥檚 correct |
That said, we do construct two separate copies of the enum type with value |
@Gerrit0 you can try a draft PR that changes this; sometimes we just don鈥檛 have great coverage/visibility about what the public checker API returns. If it doesn鈥檛 cause any breaks/changes internally we might consider it, but no guarantees. |
Yep... and this is why I think this is probably unintentional/buggy. I might have time to look into this.... in the meantime, how should I go from a |
Hey there! Just wondering if there鈥檚 any update on this? Found a few examples of this bug affecting docs in the wild: VSCode API!!!
Adobe PDF Services SDK
Sendbird Chat SDK |
Bug Report
馃攷 Search Terms
single member enum, reference types, compiler API
馃晽 Version & Regression Information
馃捇 Code
If I add a second member to the enum, the symbol references change to work as expected.
馃檨 Actual behavior
When enums have a single value, reference types which point to them have the type's symbol set to the only member of the enum, not to the enum's symbol.
馃檪 Expected behavior
When enums have any number of values, reference types pointing to them should point to the enum itself.
The text was updated successfully, but these errors were encountered: