-
Notifications
You must be signed in to change notification settings - Fork 754
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
[Improvement]: Reorder top level node list #41946
Comments
The above example in the issue works without any issue in the current implementation because although the Issue in the current approach is when we have access the annot value before the populate happens
Note that variable b is a top-level variable. The value of the |
Changes are done. 13 jballerina unit tests are filing ATM. Will send a PR soon. Below are some failing cases.
public function main() {
var input = [{name: "Saman", price: 11}];
record {|string name; int price;|}[][] res = from var {name} in input group by name
select from var {price} in input
select {name, price};
// the issue here is we create several lambda functions for the query expression and those functions
// do not have the typedesc in local variables. it seems typedesc need to be passed as a closure for those
}
|
Description
In the existing implementation, we currently reorder the constants list and the global variable list separately. However, when considering the annotations of type definitions(as annotations are part of the typedesc), they depend on the order of both constants and global variables. Therefore, it is necessary to reorder the toplevel node list instead of reordering constants, global variables, and type definitions separately.
When considering the above example, the
annot
(annotation) is a component of the type description (typedesc
) of T1. So we need to rearrange the top-level node list as follows.Describe your problem(s)
No response
Describe your solution(s)
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: