You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Alexey Afanasiev (JIRA)" <ji...@apache.org> on 2017/09/15 14:13:00 UTC

[jira] [Created] (GROOVY-8319) Improve smart type on list expresions

Alexey Afanasiev created GROOVY-8319:
----------------------------------------

             Summary: Improve smart type on list expresions
                 Key: GROOVY-8319
                 URL: https://issues.apache.org/jira/browse/GROOVY-8319
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation, Static Type Checker
    Affects Versions: 2.4.12
            Reporter: Alexey Afanasiev


Probably code below should be compiled well in CompileStatic:
{code}
def m() {
    def a  = 1
    Integer[] b = [a] // error: 'a' treats like an Object
}
{code}
and 
{code}
def m() {
     def row = ["", "", ""]
     def (left, right) = [row[0], row[1]]
     left.toUpperCase() // error: 'left' treats like an Object
}
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)