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:53:48 UTC

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

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

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


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

commit 63830feec17db7a8c5806cd2c4d5e80dd05460dd
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 b7e33b4fd2..00583880a6 100644
--- a/src/test/groovy/transform/stc/ClosuresSTCTest.groovy
+++ b/src/test/groovy/transform/stc/ClosuresSTCTest.groovy
@@ -682,6 +682,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 '''