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]: Invalid unused variable warning for a variable defined in a binding pattern #42544

Open
poorna2152 opened this issue Apr 15, 2024 · 0 comments
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@poorna2152
Copy link
Contributor

Description

Consider the following example.
Unused variable warning is given for the category variable. This was reported here and was not fixed in the PR sent for that.

type Doctor record {
    string name;
    string category;    
};

function addDoctor(Doctor doctor, string[] categories) returns error? {
    var {category} = doctor; // also getting an unused variable warning
    if !categories.some(
        existingCategory => existingCategory == category) {
        
    }
}

Steps to Reproduce

No response

Affected Version(s)

2201.9.0

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

@poorna2152 poorna2152 added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Apr 15, 2024
@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Apr 15, 2024
@poorna2152 poorna2152 removed needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Apr 15, 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
Projects
None yet
Development

No branches or pull requests

2 participants