[ 
https://issues.apache.org/jira/browse/GROOVY-3351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149574#comment-18149574
 ] 

ASF GitHub Bot commented on GROOVY-3351:
----------------------------------------

codecov-commenter commented on PR #3343:
URL: https://github.com/apache/groovy/pull/3343#issuecomment-7092180545

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3343?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `95.00000%` with `5 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.9614%. Comparing base 
([`09e84fa`](https://app.codecov.io/gh/apache/groovy/commit/09e84fa4b0d4c37a5ac2efc48dfd2db93a84cab7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`9453bc0`](https://app.codecov.io/gh/apache/groovy/commit/9453bc0b8e94ff29b5742a991b82f97825a0e1c5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3343?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...va/org/codehaus/groovy/runtime/CurriedClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FCurriedClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvQ3VycmllZENsb3N1cmUuamF2YQ==)
 | 87.1795% | [2 Missing and 3 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3343/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3343        +/-   ##
   ==================================================
   + Coverage     74.9518%   74.9614%   +0.0097%     
   - Complexity      48908      48966        +58     
   ==================================================
     Files            1768       1768                
     Lines          161213     161343       +130     
     Branches        31728      31768        +40     
   ==================================================
   + Hits           120832     120945       +113     
   - Misses          28968      28977         +9     
   - Partials        11413      11421         +8     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3343?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ava/org/codehaus/groovy/runtime/MethodClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FMethodClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvTWV0aG9kQ2xvc3VyZS5qYXZh)
 | `84.7826% <100.0000%> (+2.7313%)` | :arrow_up: |
   | 
[...us/groovy/runtime/metaclass/ClosureMetaMethod.java](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2Fmetaclass%2FClosureMetaMethod.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvbWV0YWNsYXNzL0Nsb3N1cmVNZXRhTWV0aG9kLmphdmE=)
 | `91.6667% <100.0000%> (+5.4598%)` | :arrow_up: |
   | 
[...va/org/codehaus/groovy/runtime/CurriedClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3343?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FCurriedClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvQ3VycmllZENsb3N1cmUuamF2YQ==)
 | `90.0000% <87.1795%> (-1.4894%)` | :arrow_down: |
   
   ... and [12 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3343/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Curried MethodClosure with default parameters wont work
> -------------------------------------------------------
>
>                 Key: GROOVY-3351
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3351
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.4.0
>            Reporter: Andres Almiray
>            Assignee: Daniel Sun
>            Priority: Major
>
> As detailed on this thread 
> http://www.nabble.com/Curried-closures-with-default-parameters-td21906130.html
> currying a  Methodclosure whose original method has default parameters and 
> assigning it to a metaClass means the default parameters are lost, the 
> workaround is to 'manually' curry the closure
> {code}
> class Foo {
>    static fooWithDefaults( String a1, String a2, String a3 = a2, Map a4 = [:] 
> ) { /*stuff*/ }
>    static decorate( Class klass ) {
>       klass.metaclass.foo = this.&fooWithDefaults.curry("A")
>    }
> }
> def f = new Foo()
> f.foo("B") // throws MME
> f.foo("B","C",[:]) // works
> {code}
> workaround
> {code}
> class Foo {
>    static fooWithDefaults( String a1, String a2, String a3 = a2, Map a4 = [:] 
> ) { /*stuff*/ }
>    static decorate( Class klass ) {
>       klass.metaClass.foo = { String a2, String a3 = a2, Map a4 = [:] ->
>          Foo.fooWithDefaults("A",a2,a3,a4)
>       }
>    }
> }
> {code}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to