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

Incorrect behavior of member access on xml with key value < 0 #35980

Closed
lasinicl opened this issue Apr 29, 2022 · 1 comment · Fixed by #40114
Closed

Incorrect behavior of member access on xml with key value < 0 #35980

lasinicl opened this issue Apr 29, 2022 · 1 comment · Fixed by #40114
Assignees
Labels
Lang/XML XML design related issues Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Milestone

Comments

@lasinicl
Copy link
Contributor

Description:
$title.
As per the spec when the evaluated value of the container expression is an xml and and k is < 0, then the evaluation completes abruptly with a panic
(i.e. key-expression is evaluated to get a value k)

But ATM, this result is an empty xml value.

Steps to reproduce:

function init() {
    xml v = xml `This is an xml`;
    io:println(v[-1].toBalString()); // prints xml``, but should panic
}

Affected Versions:
Ballerina 2201.0.2

@lasinicl lasinicl added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Lang/XML XML design related issues labels Apr 29, 2022
@github-actions
Copy link

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.

@pcnfernando pcnfernando added this to the 2201.6.0 milestone May 18, 2023
@pcnfernando pcnfernando added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lang/XML XML design related issues Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants