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

Introduce langlib count, first and last functions #39667

Merged
merged 6 commits into from
May 15, 2023

Conversation

KavinduZoysa
Copy link
Contributor

Purpose

Fixes #39658

@KavinduZoysa KavinduZoysa changed the title Langlib count Introduce langlib count function Feb 21, 2023
@KavinduZoysa KavinduZoysa added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Feb 21, 2023
@KavinduZoysa KavinduZoysa changed the title Introduce langlib count function Introduce langlib count, first and last functions Feb 21, 2023
@KavinduZoysa KavinduZoysa force-pushed the langlib-count branch 3 times, most recently from 8a0e69d to 91c679d Compare February 27, 2023 14:36
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Patch coverage: 77.77% and project coverage change: -0.02 ⚠️

Comparison is base (87f1f19) 77.25% compared to head (9fe3fbf) 77.23%.

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     
Impacted Files Coverage Δ
...in/java/org/ballerinalang/langlib/value/Count.java 50.00% <50.00%> (ø)
...ain/java/org/ballerinalang/langlib/value/Last.java 66.66% <66.66%> (ø)
...ballerinalang/compiler/bir/codegen/JvmCastGen.java 70.23% <100.00%> (ø)
...compiler/bir/codegen/interop/InteropMethodGen.java 80.65% <100.00%> (ø)
...inalang/compiler/bir/codegen/interop/JInterop.java 85.36% <100.00%> (ø)
...lerinalang/compiler/bir/codegen/interop/JType.java 71.87% <100.00%> (ø)

... and 19 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

# + v - first argument
# + vs - rest of the arguments
# + return - first argument
public isolated function first(Type v, (any|error)... vs) returns Type {
Copy link
Contributor

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?

Copy link
Contributor Author

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 ().

Copy link
Contributor

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)

@KavinduZoysa KavinduZoysa requested a review from gimantha March 1, 2023 07:35
@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Mar 16, 2023
@github-actions
Copy link

Closed PR due to inactivity for more than 18 days.

@github-actions github-actions bot closed this Mar 19, 2023
@gimantha gimantha removed the Stale label Mar 20, 2023
@gimantha gimantha reopened this Mar 20, 2023
@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Apr 21, 2023
@github-actions
Copy link

Closed PR due to inactivity for more than 18 days.

@github-actions github-actions bot closed this Apr 25, 2023
@KavinduZoysa KavinduZoysa reopened this Apr 26, 2023
@KavinduZoysa KavinduZoysa merged commit 7202725 into ballerina-platform:master May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: Introduce langlib function count, first and last
3 participants