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

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


The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
     new 503bd40234 STC: `extractType` discards placeholder unlike 
`getCombinedBoundType`
503bd40234 is described below

commit 503bd402340b56de2cdb61e6711d8253ce6652c8
Author: Eric Milles <eric.mil...@thomsonreuters.com>
AuthorDate: Wed Jun 11 13:56:14 2025 -0500

    STC: `extractType` discards placeholder unlike `getCombinedBoundType`
---
 .../org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java  | 2 +-
 src/test/groovy/groovy/transform/stc/MethodReferenceTest.groovy       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index 1969c8665e..c26e7d5b49 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -1774,7 +1774,7 @@ public abstract class StaticTypeCheckingSupport {
                     extractGenericsConnections(spec, type, type.redirect());
                 } else if (type.redirect().getGenericsTypes() != null) {
                     for (GenericsType tp : type.redirect().getGenericsTypes()) 
{
-                        spec.put(new GenericsTypeName(tp.getName()), new 
GenericsType(getCombinedBoundType(tp))); //GROOVY-10651
+                        spec.put(new GenericsTypeName(tp.getName()), new 
GenericsType(extractType(tp))); //GROOVY-10651
                     }
                 }
                 superClass = applyGenericsContext(spec, superClass);
diff --git a/src/test/groovy/groovy/transform/stc/MethodReferenceTest.groovy 
b/src/test/groovy/groovy/transform/stc/MethodReferenceTest.groovy
index 50fc8df9a8..02ce5fa4ab 100644
--- a/src/test/groovy/groovy/transform/stc/MethodReferenceTest.groovy
+++ b/src/test/groovy/groovy/transform/stc/MethodReferenceTest.groovy
@@ -359,8 +359,8 @@ final class MethodReferenceTest {
         assertScript shell, '''import java.util.stream.Stream
             @CompileStatic
             List<Integer> test(List<String> strings) {
-                
Stream.of(strings).flatMap(List::stream).map(Integer::valueOf).toList()
-                //                                           ^^^^^^^^^^^^^^^^
+                
Stream.of(strings).flatMap(List<String>::stream).map(Integer::valueOf).toList()
+                //                                                   
^^^^^^^^^^^^^^^^
                 // Failed to find class method 'valueOf(Object)' or instance 
method 'valueOf()'
             }
 

Reply via email to