From commits-return-5330-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Fri Feb 2 10:44:32 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 9073E180608 for ; Fri, 2 Feb 2018 10:44:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8017F160C49; Fri, 2 Feb 2018 09:44:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C943A160C41 for ; Fri, 2 Feb 2018 10:44:31 +0100 (CET) Received: (qmail 73124 invoked by uid 500); 2 Feb 2018 09:44:31 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 73115 invoked by uid 99); 2 Feb 2018 09:44:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2018 09:44:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E4C82DFAF5; Fri, 2 Feb 2018 09:44:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Add a test for GROOVY-8445 Date: Fri, 2 Feb 2018 09:44:30 +0000 (UTC) Repository: groovy Updated Branches: refs/heads/master 1594c1b4c -> fea650741 Add a test for GROOVY-8445 Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/fea65074 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/fea65074 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/fea65074 Branch: refs/heads/master Commit: fea650741f2ef500a47da010d4fb94fdbd2d2f76 Parents: 1594c1b Author: sunlan Authored: Fri Feb 2 17:44:20 2018 +0800 Committer: sunlan Committed: Fri Feb 2 17:44:20 2018 +0800 ---------------------------------------------------------------------- .../transform/stc/MethodCallsSTCTest.groovy | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/fea65074/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy ---------------------------------------------------------------------- diff --git a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy index 74c2095..4afc665 100644 --- a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy +++ b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy @@ -1238,6 +1238,26 @@ class MethodCallsSTCTest extends StaticTypeCheckingTestCase { ''' } + // GROOVY-8445 + void testGroovy8445() { + assertScript ''' + 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() { + assert 13 == Stream.of(1, 2, 3).reduce(7, {Integer r, Integer e -> r + e}); + } + } + ''' + } + static class MyMethodCallTestClass { static int mul(int... args) { args.toList().inject(1) { x,y -> x*y } }