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 2020/07/13 18:44:23 UTC

[groovy] 03/03: GROOVY-8358: add test cases

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

commit 1650577ecae5c57d79cc3715d51514b25f4f3f5f
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Mon Jul 13 13:44:00 2020 -0500

    GROOVY-8358: add test cases
---
 src/test/gls/innerClass/InnerClassTest.groovy | 50 +++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/src/test/gls/innerClass/InnerClassTest.groovy b/src/test/gls/innerClass/InnerClassTest.groovy
index d819abc..81e51d9 100644
--- a/src/test/gls/innerClass/InnerClassTest.groovy
+++ b/src/test/gls/innerClass/InnerClassTest.groovy
@@ -1166,6 +1166,56 @@ final class InnerClassTest {
         }
     }
 
+    @Test // GROOVY-8358
+    void testResolveInnerOfSuperType7() {
+        assertScript '''
+            class Outer implements I {
+                static class Inner extends C {
+                    static usage() {
+                        new T() // whoami?
+                    }
+                }
+            }
+
+            class C implements H { }
+
+            interface H {
+                static class T {}
+            }
+
+            interface I {
+                static class T {}
+            }
+
+            assert Outer.Inner.usage() instanceof H.T
+        '''
+    }
+
+    @Test // GROOVY-8358
+    void testResolveInnerOfSuperType8() {
+        assertScript '''
+            class C implements H { } // moved ahead of Outer
+
+            class Outer implements I {
+                static class Inner extends C {
+                    static usage() {
+                        new T() // whoami?
+                    }
+                }
+            }
+
+            interface H {
+                static class T {}
+            }
+
+            interface I {
+                static class T {}
+            }
+
+            assert Outer.Inner.usage() instanceof H.T
+        '''
+    }
+
     @Test // GROOVY-5679, GROOVY-5681
     void testEnclosingMethodIsSet() {
         assertScript '''