Daniel Sun created GROOVY-12805:
-----------------------------------
Summary: STC: Iterator.inject lacks @ClosureParams, so the closure
parameters are untyped
Key: GROOVY-12805
URL: https://issues.apache.org/jira/browse/GROOVY-12805
Project: Groovy
Issue Type: Bug
Components: groovy-jdk, Static Type Checker
Reporter: Daniel Sun
groovy.transform.stc.ClosureParamTypeInferenceSTCTest#testDGM_injectOnIterator
in src/test/groovy/groovy/transform/stc/ClosureParamTypeInferenceSTCTest.groovy
is @NotYetImplemented. It does
['a','bb','ccc'].iterator().inject { acc, str -> acc += str.toUpperCase();
acc }
and comments that this hits inject(Object,Closure) without metadata, so str is
not inferred as String.
Collection and array inject overloads in the same class already pass.
GROOVY-7934 (Open) is about initial-value / LUB inference for inject under
@CompileStatic, not missing parameter metadata on the Iterator overload.
Scanned SHA: ca71425976fd2e3da6db9634955ba0d39550a6d4 (apache/groovy master).
Acceptance criterion: The Iterator.inject DGM overload carries @ClosureParams
(or equivalent) so the test type-checks and passes, and @NotYetImplemented is
removed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)