You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/15 14:19:01 UTC
[jira] [Commented] (GROOVY-8319) Improve smart type on list
expresions
[ https://issues.apache.org/jira/browse/GROOVY-8319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167924#comment-16167924 ]
ASF GitHub Bot commented on GROOVY-8319:
----------------------------------------
GitHub user avafanasiev opened a pull request:
https://github.com/apache/groovy/pull/602
GROOVY-8319: Improve smart type on list expressions
I hope it should work like expected.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/avafanasiev/groovy master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/602.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #602
----
commit 31792951288d2af1763a16ca81441ca18f5ba141
Author: alexey.afanasiev <al...@jetbrains.com>
Date: 2017-09-15T14:16:11Z
GROOVY-8319: Improve smart type on list expressions
----
> 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)