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 69a4402f80 GROOVY-10767: add test case
69a4402f80 is described below

commit 69a4402f8033303ce979e41ae66983494f02f337
Author: Eric Milles <[email protected]>
AuthorDate: Thu Sep 22 12:46:10 2022 -0500

    GROOVY-10767: add test case
---
 .../traitx/TraitASTTransformationTest.groovy       | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git 
a/src/test/org/codehaus/groovy/transform/traitx/TraitASTTransformationTest.groovy
 
b/src/test/org/codehaus/groovy/transform/traitx/TraitASTTransformationTest.groovy
index 9f925c8748..4763b3701c 100644
--- 
a/src/test/org/codehaus/groovy/transform/traitx/TraitASTTransformationTest.groovy
+++ 
b/src/test/org/codehaus/groovy/transform/traitx/TraitASTTransformationTest.groovy
@@ -2837,6 +2837,35 @@ final class TraitASTTransformationTest {
         '''
     }
 
+    @Test // GROOVY-10767
+    void testSimpleSelfTypeInSubTrait2() {
+        assertScript shell, '''
+            trait A {
+                void methodA() {
+                }
+            }
+            @TypeChecked
+            @SelfType(T)
+            trait B implements A {
+                void methodB() {
+                    methodA() // Cannot find matching method 
<UnionType:T+B>#methodA()
+                }
+            }
+            class C extends T implements B {
+                void method() {
+                    methodA()
+                    methodB()
+                }
+            }
+            class T {
+                void methodT() {
+                }
+            }
+
+            new C().method()
+        '''
+    }
+
     @Test
     void testDoubleSelfType() {
         assertScript shell, '''

Reply via email to