groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-8319) Improve smart type on list expresions
Date Fri, 15 Sep 2017 16:35:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Sun closed GROOVY-8319.
------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.6.0-alpha-2
                   2.4.13
                   2.5.0-beta-2
                   3.0.0-alpha-1

Thanks for your patch!

> 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
>            Assignee: Daniel Sun
>             Fix For: 3.0.0-alpha-1, 2.5.0-beta-2, 2.4.13, 2.6.0-alpha-2
>
>
> 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)

Mime
View raw message