-
Notifications
You must be signed in to change notification settings - Fork 758
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Unable to distinguish enum symbol from union-type symbol in Semantic API #38179
Comments
We can get the enum-type by |
enum Result {
NOTAVAILABLE,
AVAILABLE
}
type RAction Result; When we are going to take typeDescriptor() from Reference issue: ballerina-platform/ballerina-library#5123 |
This is a kind of expected behavior (according to the design decisions). Therefore, we are fixing @lnash94's original issue (which is "unable to distinguish enum and union-type) by introducing new APIs within
|
Changing the issue title to "[Bug]: Unable to distinguish enum symbol from union-type symbol in Semantic API" due to this
|
We had a discussion sometime back with @MaryamZi and @lnash94, and decided not to send any updates for this since we shouldn't expose any attributes through UnionTypeSymbol to check whether it is an enum or not (complying with the spec), The correct behaviour would be - the Semantic API user should get the visible-symbols and retrieve the enum symbol |
Closing this due to the last comment |
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now. |
Description
Consider following code
TypeReferenceTypeSymbol typeReferenceTypeSymbol = <State>;
// I have set the State as typereferenceTypeSymbolcalling
typeReferenceTypeSymbol.typeDescriptor()
returnsUnionTypeSymbol
but it should returnEnumSymbol
Steps to Reproduce
No response
Affected Version(s)
No response
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: