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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2353?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 `77.27273%` with `15 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 67.0155%. Comparing base 
([`cc8bc3e`](https://app.codecov.io/gh/apache/groovy/commit/cc8bc3e408f5bc7a6779c70f11a29a4cffdf04a8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`4ca951d`](https://app.codecov.io/gh/apache/groovy/commit/4ca951d315227c538922c81c81cd651afd2bc4c1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2353?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2353?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
 | 76.9231% | [7 Missing and 8 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2353?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/2353/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/2353?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2353        +/-   ##
   ==================================================
   + Coverage     67.0080%   67.0155%   +0.0076%     
   - Complexity      29357      29377        +20     
   ==================================================
     Files            1382       1382                
     Lines          116619     116664        +45     
     Branches        20444      20457        +13     
   ==================================================
   + Hits            78144      78183        +39     
   - Misses          32039      32041         +2     
   - Partials         6436       6440         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2353?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...groovy/classgen/asm/sc/StaticTypesTypeChooser.java](https://app.codecov.io/gh/apache/groovy/pull/2353?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesTypeChooser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1R5cGVDaG9vc2VyLmphdmE=)
 | `100.0000% <100.0000%> (ø)` | |
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2353?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
 | `87.6383% <76.9231%> (-0.0963%)` | :arrow_down: |
   
   ... and [6 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2353/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>




> @CS flow typing incorrectly casting to map at runtime
> -----------------------------------------------------
>
>                 Key: GROOVY-7971
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7971
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.7
>            Reporter: Graeme Rocher
>            Assignee: Eric Milles
>            Priority: Major
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> The following code:
> {code}
> import groovy.json.*
> import groovy.transform.*
> @CompileStatic
> class Bar {
>     private Writable renderTemplate(Object o, Map args) {
>     
>     }
>     private boolean isSimpleType(Class type) {
>         return type == String
>     }
>     def foo(Map map, Map arguments) {
>     
>         def writable = new Writable() {
>             @Override
>             Writer writeTo(Writer out) throws IOException {
>                 for(entry in map.entrySet()) {
>                    def value = entry.value
>                    if(isSimpleType(value.getClass()) || (value instanceof 
> Map)) {
>                         out.append(JsonOutput.toJson(value))
>                     }
>                 }
>                 return out
>             }
>         }
>     }
> }
> writable = new Bar().foo([one:'two'],[foo:'bar'])
> sw = new StringWriter()
> writable.writeTo(sw)
> println sw
> {code}
> Fails with:
> {code}
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'two' with class 'java.lang.String' to class 'java.util.Map'
>       at 
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:405)
>       at 
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:319)
>       at 
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:232)
>       
> {code}
> For some reason Groovy is attempting to cast value to Map when it isn't one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to