-
Notifications
You must be signed in to change notification settings - Fork 743
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
Improve uninitialised variable analysis for statements with on-fail #40971
Conversation
(cherry picked from commit 3177740)
…ina-lang into issue_38530 # Conflicts: # compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DataflowAnalyzer.java # tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/onfail/OnFailClauseTest.java # tests/jballerina-unit-test/src/test/resources/test-src/statements/onfail/on-fail-clause-negative-v2.bal
import ballerina/io;
public function main() returns error? {
int i;
do {
// check error("error");
var _ = object {
function init() {
i = 2;
io:println("222");
}
};
} on fail {
io:println("on fail");
}
io:println(i);
} Please check this example. The expected output is not clear. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #40971 +/- ##
=============================================
+ Coverage 0.00% 76.41% +76.41%
- Complexity 0 52146 +52146
=============================================
Files 9 2858 +2849
Lines 35 196060 +196025
Branches 0 25411 +25411
=============================================
+ Hits 0 149810 +149810
- Misses 35 37948 +37913
- Partials 0 8302 +8302
☔ View full report in Codecov by Sentry. |
This is not actually related to on-fail import ballerina/io;
public function main() returns error? {
int i;
var _ = object {
function init() {
i = 2;
io:println("222");
}
};
io:println(i); // uninint var error
} Hence, created #41013 |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Purpose
Approach
Samples
Remarks
Check List