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 <sun...@apache.org> Authored: Fri Feb 2 17:44:20 2018 +0800 Committer: sunlan <sun...@apache.org> 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 } }