Eric Milles created GROOVY-8882:
-----------------------------------

             Summary: STC: Loop over elements of String has different element 
type
                 Key: GROOVY-8882
                 URL: https://issues.apache.org/jira/browse/GROOVY-8882
             Project: Groovy
          Issue Type: Documentation
            Reporter: Eric Milles


When the method below is executed as-is, the output is "java.lang.String" x3.  
When {{@CompileStatic}} is uncommented, the output is "java.lang.Character" x3. 
 Is it possible to have dynamic groovy match the static compilation result?

{code:groovy}
//@groovy.transform.CompileStatic
void meth() {
  for (c in 'abc')
    println c.class.name
}
{code}

Similarly, {{'abc'*.anything}} runs against Strings of length one instead of 
Characters.  Although, spread-dot is not supported against strings under static 
compilation.  Is it possible to add that support?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to