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]: Record literal expression error evaluation create infinite loop #42728
Comments
Removing the |
import ballerinax/health.fhir.r4;
public type Extension int|record {|string url;|};
r4:Extension[] k = [
{
"url": "tribalAffiliation",
"valueCodeableConcept": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-TribalEntityUS",
"code": "187",
"display": "Paiute-Shoshone Tribe of the Fallon Reservation and Colony, Nevada"
}
],
"text": "Shoshone"
}
}
];
public function main() {
}; When considering the BIR of the above program, it contains 53 anonymous types, which is incorrect. This issue occur from unnecessary cloning of nodes in the type checker. Each cloned node contains an anonymous record, leading to the generation of a type definition for each record. BIR of the above program
|
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. |
Description
$subject
Steps to Reproduce
The compiler type-checker creates unnecessary anonymous record types when evaluating record literals and logging an error.
ballerina-lang/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeChecker.java
Line 1907 in 89f1a39
The log error call creates new anonymous record types in a loop. This results in around 12000 new
anonType_
type definitions which causefile too large
andmethod too large
errors in code generation.Please refer to the code provided at https://github.com/wso2-enterprise/internal-support-ballerina/issues/672
Affected Version(s)
2201.8.x and onwards
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
https://github.com/wso2-enterprise/internal-support-ballerina/issues/672
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: