You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2018/05/28 15:41:00 UTC
[jira] [Updated] (GROOVY-8613) GCE in elvis assignment evaluation
[ https://issues.apache.org/jira/browse/GROOVY-8613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniil Ovchinnikov updated GROOVY-8613:
---------------------------------------
Summary: GCE in elvis assignment evaluation (was: CCE in elvis assignment evaluation)
> GCE in elvis assignment evaluation
> ----------------------------------
>
> Key: GROOVY-8613
> URL: https://issues.apache.org/jira/browse/GROOVY-8613
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Affects Versions: 3.0.0-alpha-2
> Reporter: Daniil Ovchinnikov
> Priority: Critical
>
> {code:java}
> @groovy.transform.CompileStatic
> def foo() {
> def a = 0
> a ?= 1
> println a // 1
> def b = 0
> b ?= "hello"
> println b // expected: "hello", actual: "GroovyCastException: Cannot cast 'String' to 'int'"
> }
> foo()
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)