You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/03/29 17:37:00 UTC
[jira] [Updated] (GROOVY-9974) @CompileStatic with Method
References
[ https://issues.apache.org/jira/browse/GROOVY-9974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-9974:
--------------------------------
Fix Version/s: 3.0.8
> @CompileStatic with Method References
> -------------------------------------
>
> Key: GROOVY-9974
> URL: https://issues.apache.org/jira/browse/GROOVY-9974
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 3.0.6, 3.0.7
> Environment: JDK 11
> Reporter: Michael Spahn
> Assignee: Eric Milles
> Priority: Major
> Fix For: 3.0.8, 4.0.0-alpha-3
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The following code worked fine until 3.0.5:
> {code:java}
> @Test
> @CompileStatic
> void methodReference() {
> def list = ['']
> list.removeIf(String::isBlank)
> assert list.empty
> }
> {code}
> Using version 3.0.6/3.0.7 this no longer compiles:
> {noformat}
> Groovyc: [Static type checking] - Cannot call java.util.List <java.lang.String>#removeIf(java.util.function.Predicate <? super java.lang.String>) with arguments [groovy.lang.Closure <java.lang.Boolean>]
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)