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

Match values for >= etc #15199

Open
robbla opened this issue Feb 26, 2019 · 2 comments

Comments

2 participants
@robbla
Copy link

commented Feb 26, 2019

Currently Match only allows for exact matches like 3 or Gold.

Support for operators like >, <, >= etc would be great as well as the support for variables and formulas.

Added the request for this functionality following a slack mailthread.

@hasithaa

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

@maheshika Can we move this issue https://github.com/ballerina-platform/ballerina-spec as this is a feature request to the language.

@maheshika maheshika transferred this issue from ballerina-platform/ballerina-lang May 2, 2019

@maheshika maheshika transferred this issue from ballerina-platform/ballerina-spec May 2, 2019

@hasithaa

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

Spec supports this. My Bad. The current compiler doesn't support this. Hence Issue is moved back to Ballerina-lang.

According to the spec following should work.

match x {
  y if y is int && y > 5 => { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.