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]: JvmCodeGenUtil reaches error while generating method for the below sample #43531

Open
rdulmina opened this issue Oct 29, 2024 · 1 comment · May be fixed by #43563
Open

[Bug]: JvmCodeGenUtil reaches error while generating method for the below sample #43531

rdulmina opened this issue Oct 29, 2024 · 1 comment · May be fixed by #43563
Assignees
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug userCategory/Compilation

Comments

@rdulmina
Copy link
Contributor

Description

JvmCodeGenUtil reaches error while generating method for the below sample

isolated function getAsInt(string s) returns int {
    return 777;
}

public type Bar record {
    int a = getAsInt("777");
    int b = 56;
};

public function testRecordInitWithFuncCalls() returns Bar {
    Bar b = {};
    return b;
}

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

@rdulmina rdulmina added Type/Bug Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime userCategory/Compilation labels Oct 29, 2024
@rdulmina rdulmina self-assigned this Oct 29, 2024
@Thushara-Piyasekara
Copy link
Contributor

The sample code can be simplified to the following,

isolated function getAsInt(string s) returns int {
    return 777;
}

type Bar record {
    int a = getAsInt("777");
};

function testRecordInitWithFuncCalls() returns Bar {
    return {};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug userCategory/Compilation
Projects
None yet
2 participants