groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject incubator-groovy git commit: GROOVY-7477: CompileStatic-related "BUG! exception in phase 'instruction selection'"
Date Sun, 28 Jun 2015 10:06:12 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X c7769effd -> bbf49e263


GROOVY-7477: CompileStatic-related "BUG! exception in phase 'instruction selection'"


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/bbf49e26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/bbf49e26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/bbf49e26

Branch: refs/heads/GROOVY_2_4_X
Commit: bbf49e263597a31fc53b9f98e063e87c8b0a7f73
Parents: c7769ef
Author: Paul King <paulk@asert.com.au>
Authored: Sat Jun 27 11:01:35 2015 +1000
Committer: Paul King <paulk@asert.com.au>
Committed: Sun Jun 28 20:05:55 2015 +1000

----------------------------------------------------------------------
 .../groovy/transform/stc/StaticTypeCheckingSupport.java  |  2 +-
 src/test/groovy/transform/stc/BugsSTCTest.groovy         | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/bbf49e26/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index fee1312..2fa0e5c 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -1599,7 +1599,7 @@ public abstract class StaticTypeCheckingSupport {
      */
     static void extractGenericsConnections(Map<String, GenericsType> connections, ClassNode
type, ClassNode target) {
         if (target==null || type==target || !isUsingGenericsOrIsArrayUsingGenerics(target))
return;
-        if (type==UNKNOWN_PARAMETER_TYPE) return;
+        if (type == null || type==UNKNOWN_PARAMETER_TYPE) return;
         if (type.isArray() && target.isArray()) {
             extractGenericsConnections(connections, type.getComponentType(), target.getComponentType());
         } else if (target.isGenericsPlaceHolder() || type.equals(target) || !implementsInterfaceOrIsSubclassOf(type,
target)) {

http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/bbf49e26/src/test/groovy/transform/stc/BugsSTCTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/transform/stc/BugsSTCTest.groovy b/src/test/groovy/transform/stc/BugsSTCTest.groovy
index 432d865..2962e39 100644
--- a/src/test/groovy/transform/stc/BugsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/BugsSTCTest.groovy
@@ -135,6 +135,17 @@ class BugsSTCTest extends StaticTypeCheckingTestCase {
         '''
     }
 
+    void testGroovy7477NullGenericsType() {
+        assertScript '''
+        class L<E> extends ArrayList<E> {
+            boolean removeIf(Comparator<? super E> filter) { }
+        }
+        L<String> items = ['foo', 'bar'] as L<String>
+        items.removeIf({a, b -> 1} as Comparator<?>)
+        assert items
+        '''
+    }
+
     void testGroovy5482ListsAndFlowTyping() {
         assertScript '''
         class StaticGroovy2 {


Mime
View raw message