Closed TharmiganK closed 3 days ago
Seems to be happening with langlib function calls.
Reproducible when the function is in the source too, rather than tests.
Source
public function includesFn(string a, string b) returns boolean {
return a.includes(b);
}
Tests
import ballerina/test;
@test:Config
function test() {
boolean res = includesFn("foo", "bar");
test:assertFalse(res);
}
Issue could be related to io.ballerina.projects.UsedBIRNodeAnalyzer.InvocationData#registerNodes
since the function pool is not populated for langlibs.
Seems like the error goes away when the start index is provided.
E.g.,
return a.includes(b, 4);
We've added some fixes which are available with 2201.11.0-20241111-101700-af28a18f
, can you please check with this version?
We've added some fixes which are available with
2201.11.0-20241111-101700-af28a18f
, can you please check with this version?
With the provided timestamped version, the tests are running without any NPE issues. Hence closing this issue
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.
- Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
- Reason/Regression - The issue has introduced a regression.
- Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
- Reason/Complex - Issue occurred due to complex scenario.
- Reason/Invalid - Issue is invalid.
- Reason/Other - None of the above cases.
Description
Getting the following error when running a simple test assertion with string
includes
API.This is found while checking url module with dead code elimination(Related task - https://github.com/ballerina-platform/ballerina-library/issues/7339)
Steps to Reproduce
Try to run the following test with dead code elimination feature:
Affected Version(s)
Ballerina SwanLake Update 11(2201.11.x)
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