Skip to content
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]: Getting error: jVM generation is not supported for type other when trying to use query expression #43749

Open
tharindu-nw opened this issue Jan 16, 2025 · 0 comments
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation

Comments

@tharindu-nw
Copy link
Contributor

Description

I have the following code:

import ballerina/io;

enum UserRole {
    ADMIN = "admin",
    DEVELOPER = "developer"
};

type InvitationResponseItem record {|
    string id;
    string 'handle;
    UserRole[] groups;
    string email;
|};

public function main() {
    InvitationResponseItem[] getInvitationsResp = [
        {"id":"4ee350de-f070-46b5-bbc7-79a847c4ed61", "handle":"dungeons", "groups":["developer"], "email":"[email protected]"}, 
        {"id":"e4755f3d-1db3-4e94-b7fc-a236724f42b4", "handle":"dungeons", "groups":["admin"], "email":"[email protected]"}
    ];

    UserRole devRole = from InvitationResponseItem item in getInvitationsResp
                                where item.email == "[email protected]"
                                limit 1
                                select item.groups[0];
    io:println("User role: ", devRole);
}

I get the following error:

$ bal run
Compiling source
	tharinduwe/bal_demo:0.1.0
error: jVM generation is not supported for type other

Steps to Reproduce

Copy paste the above code and run.

Affected Version(s)

Ballerina 2201.10.0

OS, DB, other environment details and versions

MacOS Sonoma

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation
Projects
None yet
Development

No branches or pull requests

2 participants