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 2018/05/15 11:36:00 UTC
[jira] [Commented] (GROOVY-8355) Instanceof inference does not work
on field assigning
[ https://issues.apache.org/jira/browse/GROOVY-8355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16475689#comment-16475689 ]
ASF GitHub Bot commented on GROOVY-8355:
----------------------------------------
GitHub user danielsun1106 opened a pull request:
https://github.com/apache/groovy/pull/706
GROOVY-8355: Instanceof inference does not work on field assigning
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/danielsun1106/groovy GROOVY-8355
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/706.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 #706
----
commit cdf254c3814415bebba622da43f2e5243cfdbcf5
Author: Daniel Sun <re...@...>
Date: 2018-05-15T11:34:24Z
GROOVY-8355: Instanceof inference does not work on field assigning
----
> Instanceof inference does not work on field assigning
> -----------------------------------------------------
>
> Key: GROOVY-8355
> URL: https://issues.apache.org/jira/browse/GROOVY-8355
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Reporter: Alexey Afanasiev
> Priority: Major
>
> If instanceof inference works as expected [https://issues.apache.org/jira/browse/GROOVY-8293] So probably this code should work to:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Foo {
> Object str = new Object()
> def bar() {
> str = "str"
> str.toUpperCase() // here compile error
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)