-
Notifications
You must be signed in to change notification settings - Fork 755
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
Introduce langlib count
, first
and last
functions
#39667
Introduce langlib count
, first
and last
functions
#39667
Conversation
76ccb5d
to
8a67a67
Compare
count
functioncount
, first
and last
functions
8a67a67
to
0902723
Compare
8a0e69d
to
91c679d
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #39667 +/- ##
============================================
- Coverage 77.25% 77.23% -0.02%
- Complexity 54292 54295 +3
============================================
Files 3341 3343 +2
Lines 201512 201517 +5
Branches 25874 25875 +1
============================================
- Hits 155670 155651 -19
- Misses 37393 37421 +28
+ Partials 8449 8445 -4
☔ View full report in Codecov by Sentry. |
# + v - first argument | ||
# + vs - rest of the arguments | ||
# + return - first argument | ||
public isolated function first(Type v, (any|error)... vs) returns Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to return () when there are no arguments in the min/amx/last/first/avg right?, Shall we add tests for those cases as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check this comment. ballerina-platform/ballerina-spec#1135 (comment)
Among last/first/count
, only the count
can have no args. In that case, also we have to return 0. Check the test case. Therefore There is not a case of returning ()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was posted after that: ballerina-platform/ballerina-spec#1135 (comment)
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Closed PR due to inactivity for more than 18 days. |
langlib/lang.value/src/main/java/org/ballerinalang/langlib/value/Count.java
Outdated
Show resolved
Hide resolved
91c679d
to
17c3ca3
Compare
d369398
to
1238f01
Compare
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Closed PR due to inactivity for more than 18 days. |
83058d2
to
10c3777
Compare
Purpose
Fixes #39658