Skip to content

Comments

Filter out uninitialized variable error for assignment targets#659

Merged
LakshanWeerasinghe merged 2 commits intoballerina-platform:1.5.xfrom
pasindufernando1:2294Fix
Jan 27, 2026
Merged

Filter out uninitialized variable error for assignment targets#659
LakshanWeerasinghe merged 2 commits intoballerina-platform:1.5.xfrom
pasindufernando1:2294Fix

Conversation

@pasindufernando1
Copy link
Contributor

Copilot AI review requested due to automatic review settings January 27, 2026 05:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes issue #2294 by filtering out uninitialized variable errors for assignment targets in the expression editor diagnostics.

Changes:

  • Added filtering for USAGE_OF_UNINITIALIZED_VARIABLE diagnostic error code in LvExpressionDiagnosticRequest
  • Added test case to verify that uninitialized variable errors are properly suppressed for assignment targets

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
LvExpressionDiagnosticRequest.java Added constant and filter logic to suppress uninitialized variable diagnostics for left-value expressions
variable9.json Test configuration file verifying that uninitialized variables in assignment contexts show no diagnostics
empty.bal Test source file containing an uninitialized variable declaration to validate the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LakshanWeerasinghe LakshanWeerasinghe merged commit 48663d9 into ballerina-platform:1.5.x Jan 27, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants