You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2018/12/11 15:32:00 UTC
[jira] [Resolved] (GROOVY-8917) Failed to infer parameter type of
some SAM, e.g. BinaryOperator
[ https://issues.apache.org/jira/browse/GROOVY-8917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun resolved GROOVY-8917.
--------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0-alpha-4
Fixed by https://github.com/apache/groovy/commit/1bd305bfb2b6b3d5ed02947f0117470a6e43c5fe
> Failed to infer parameter type of some SAM, e.g. BinaryOperator
> ---------------------------------------------------------------
>
> Key: GROOVY-8917
> URL: https://issues.apache.org/jira/browse/GROOVY-8917
> Project: Groovy
> Issue Type: Bug
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 3.0.0-alpha-4
>
>
> {code:java}
> import groovy.transform.CompileStatic
> import java.util.stream.Collectors
> import java.util.stream.Stream
>
> @CompileStatic
> public class Test1 {
> public static void main(String[] args) {
> p();
> }
>
> public static void p() {
> // If we do not explicitly declare the type of parameter, STC fails
> assert 13 == [1, 2, 3].stream().reduce(7, (Integer r, Integer e) -> r + e);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)