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 63a15d7261 GROOVY-10767: add test case
63a15d7261 is described below
commit 63a15d7261d3d236bb57b5d0da5f4dedf418d258
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 deb5918464..5e50a629ea 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, '''