Graeme Rocher created GROOVY-7999:
-------------------------------------

             Summary: Disallow automatic String conversion in static 
compilation context
                 Key: GROOVY-7999
                 URL: https://issues.apache.org/jira/browse/GROOVY-7999
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.4.7
            Reporter: Graeme Rocher


This code:

{code}
@groovy.transform.CompileStatic
class Bar {
    protected List bar = []
    
    boolean doStuff() {
        String bar = this.bar
        return bar.isEmpty()
    }
}

new Bar().doStuff()
{code}

Prints false. IMO it should not be possible to assign a List to a String and in 
a static compilation context this should be a compilation error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to