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]: blangPackage become null for the module context created for the error module #43652

Open
chiranSachintha opened this issue Nov 26, 2024 · 0 comments
Assignees
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation

Comments

@chiranSachintha
Copy link
Member

chiranSachintha commented Nov 26, 2024

Description

test_proj

public type Config record {|
    int value;
|};

public annotation Config annot on type;

public function main() {
    
}

test_proj.mod's tests

import ballerina/test;
import test_proj;

@test_proj:annot {
    value: 100
}
type TestType record {|

|};

@test:Config
function testFn() {
}
[2024-11-26 11:32:12,484] SEVERE {b7a.log.crash} - Compile the module first! 
java.lang.IllegalStateException: Compile the module first!
        at io.ballerina.projects.ModuleContext.getBLangPackageOrThrow(ModuleContext.java:227)
        at io.ballerina.projects.ModuleContext.bLangPackage(ModuleContext.java:214)
        at io.ballerina.projects.JBallerinaBackend.markTestDependenciesForDuplicateBIRGen(JBallerinaBackend.java:294)
        at io.ballerina.projects.JBallerinaBackend.performCodeGen(JBallerinaBackend.java:193)
        at io.ballerina.projects.JBallerinaBackend.<init>(JBallerinaBackend.java:180)
        at io.ballerina.projects.JBallerinaBackend.lambda$from$0(JBallerinaBackend.java:150)
        at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228)
        at io.ballerina.projects.PackageCompilation.getCompilerBackend(PackageCompilation.java:179)
        at io.ballerina.projects.JBallerinaBackend.from(JBallerinaBackend.java:149)
        at io.ballerina.projects.JBallerinaBackend.from(JBallerinaBackend.java:137)
        at io.ballerina.cli.task.CompileTask.execute(CompileTask.java:242)
        at io.ballerina.cli.TaskExecutor.executeTasks(TaskExecutor.java:40)
        at io.ballerina.cli.cmd.TestCommand.execute(TestCommand.java:415)
        at java.base/java.util.Optional.ifPresent(Optional.java:178)
        at io.ballerina.cli.launcher.Main.main(Main.java:63)

blangPackage become null for the module context created for the error module

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

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Nov 26, 2024
@chiranSachintha chiranSachintha added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. and removed needTriage The issue has to be inspected and labeled manually labels Nov 26, 2024
@chiranSachintha chiranSachintha self-assigned this Nov 26, 2024
@chiranSachintha chiranSachintha changed the title [Bug]: Duplicate module context for error Module [Bug]: blangPackage become null for the module context created for the error module Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation
Projects
Status: PR Sent
Development

No branches or pull requests

2 participants