You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2024/06/04 13:44:34 UTC

(groovy) branch master updated: GROOVY-11397: add test case

This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 19fdae9132 GROOVY-11397: add test case
19fdae9132 is described below

commit 19fdae91324a8fedae0cee301f4b9222bc12102f
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Jun 4 08:25:09 2024 -0500

    GROOVY-11397: add test case
---
 src/test/groovy/transform/stc/ClosuresSTCTest.groovy | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/test/groovy/transform/stc/ClosuresSTCTest.groovy b/src/test/groovy/transform/stc/ClosuresSTCTest.groovy
index ae98a9a828..dd97c2b9b8 100644
--- a/src/test/groovy/transform/stc/ClosuresSTCTest.groovy
+++ b/src/test/groovy/transform/stc/ClosuresSTCTest.groovy
@@ -680,6 +680,20 @@ class ClosuresSTCTest extends StaticTypeCheckingTestCase {
         }
     }
 
+    // GROOVY-11397
+    void testSAMsInMethodSelection7() {
+        assertScript '''
+            interface Action<T> { void run(T t) }
+            interface Proc { void doSomething() }
+            void trigger(Action<Proc> action) {
+                action.run({->})
+            }
+            trigger { Proc it ->
+                it.doSomething()
+            }
+        '''
+    }
+
     // GROOVY-6238
     void testDirectMethodCallOnClosureExpression() {
         assertScript '''