ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Bug]: Invalid code action provided for a function call with a check expression

Open nipunayf opened this issue 1 year ago • 0 comments

Description

As shown below, the correct CA is to change the variable type from boolean to string. Instead, there is a redundant CA Change return type to 'error' that has no impact on the code.

image

Steps to Reproduce

Prompt for code actions for the cursor position.

function retValue() returns string|error {
    return "Hello, World!";
}

function name() returns error {
    boolean a = check retValue<CURSOR>();
}

Affected Version(s)

Ballerina 2201.8.6 (Swan Lake Update 8)

OS, DB, other environment details and versions

OS: macOS 14.2.1 23C71 JDK: openjdk 17.0.8 2023-07-18

Related area

-> Compilation

Related issue(s) (optional)

https://github.com/ballerina-platform/ballerina-lang/issues/42029

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

nipunayf avatar Mar 21 '24 18:03 nipunayf