[ https://issues.apache.org/jira/browse/GROOVY-7432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560723#comment-14560723 ]
Paul King commented on GROOVY-7432: ----------------------------------- Re: Using {{CharSequence}} with {{@ClosureParams}}: We want {{String}} as the first option because we want the type checker to allow all of the String methods for inference purposes if no explicit type is given. You could consider adding {{CharSequence}} as an additional option but because of our little trick with the resolver, that would be misleading/confusing in terms of what things we would let the type checker pass vs what could fail subsequently at runtime. So, in summary, what is there is what we want. > Enhance CharSequence with appropriate Iterable extension methods > ---------------------------------------------------------------- > > Key: GROOVY-7432 > URL: https://issues.apache.org/jira/browse/GROOVY-7432 > Project: Groovy > Issue Type: Improvement > Components: groovy-jdk > Reporter: Peter Ledbrook > Assignee: Guillaume Laforge > > Groovy enables developers to treat {{CharSequence}}s as if they were true > sequences. For example, you can use a for loop and the array index operator. > Some extension methods are missing though. One I was hoping to find was the > {{count(Closure)}} method. I think it makes sense to incorporate any > {{Iterable}} extension methods into {{CharSequence}} as well. -- This message was sent by Atlassian JIRA (v6.3.4#6332)