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

Actions allowed within let expressions #22701

Open
pubudu91 opened this issue Apr 17, 2020 · 1 comment
Open

Actions allowed within let expressions #22701

pubudu91 opened this issue Apr 17, 2020 · 1 comment
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler SwanLake2023 Temporary Label for issue to be fixed immediately. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug Type/Improvement

Comments

@pubudu91
Copy link
Contributor

The following compiles and runs fine:

public function main() {
    int lx = let int i = f1->getInt() in i * 2;
}

The above should result in a compile error. The issue in the above is in how let expressions are modeled.

@hasithaa
Copy link
Contributor

This is fixed with the new Parser. But Parser can't correctly identify this error. Get the following output.

error: .::test.bal:2:28: missing in keyword
error: .::test.bal:2:28: missing identifier
error: .::test.bal:2:39: missing semicolon token
error: .::test.bal:2:42: invalid token 'in'
error: .::test.bal:2:42: invalid expression statement

@hasithaa hasithaa added Area/Parser Everything related to the ballerina lexer and the parser #Compiler Type/Improvement Later Not planned for Swan Lake GA release and removed Type/Bug Type/SpecDeviation labels Aug 25, 2020
@hasithaa hasithaa removed this from Needs triage in Ballerina Compiler Bug triage Aug 25, 2020
@hasithaa hasithaa added Type/Bug SwanLake2023 Temporary Label for issue to be fixed immediately. and removed Later Not planned for Swan Lake GA release labels Feb 17, 2023
@hasithaa hasithaa assigned ushirask and unassigned ushirask Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler SwanLake2023 Temporary Label for issue to be fixed immediately. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug Type/Improvement
Projects
None yet
Development

No branches or pull requests

5 participants