Skip to content
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]: Crash in query-expr in select clause #40242

Open
KavinduZoysa opened this issue Apr 18, 2023 · 0 comments
Open

[Bug]: Crash in query-expr in select clause #40242

KavinduZoysa opened this issue Apr 18, 2023 · 0 comments
Labels
Lang/Expressions/Query Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@KavinduZoysa
Copy link
Contributor

Description

When there is a query-expr as the expression in select-clause, that creates list-ctr by using variables in main from-clause, the compiler crashes.

Steps to Reproduce

import ballerina/io;

type Rec record {|
    string name;
    int[] price1;
|};

public function main() {
    Rec[] input = [{name: "Saman", price1: [11]},
                    {name: "Kamal", price1: [10]},
                    {name: "Amal", price1: [10]}];
    int[][][][] prices = from var {name, price1} in input
                        select from var _ in input
                                select [[...price1]];
    // var prices = ... also crashes
    io:println(prices);
}

Affected Version(s)

2201.4.1

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

@KavinduZoysa KavinduZoysa added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Lang/Expressions/Query labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lang/Expressions/Query Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
None yet
Development

No branches or pull requests

1 participant