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 3d33b82028 GROOVY-11548: add test case
3d33b82028 is described below

commit 3d33b820284fd6171c799dd8b241b7804c0965fa
Author: Eric Milles <[email protected]>
AuthorDate: Mon Feb 17 18:16:21 2025 -0600

    GROOVY-11548: add test case
---
 src/test/groovy/OverrideTest.groovy | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/test/groovy/OverrideTest.groovy 
b/src/test/groovy/OverrideTest.groovy
index d16dbdb70d..6b66b126f2 100644
--- a/src/test/groovy/OverrideTest.groovy
+++ b/src/test/groovy/OverrideTest.groovy
@@ -258,4 +258,23 @@ final class OverrideTest {
             new TemplatedInterfaceImplementation()
         '''
     }
+
+    // GROOVY-11548
+    @Test
+    void testDefaultMethodDoesNotOverride() {
+        for (kind in ['def', 'final', 'public']) {
+            assertScript """
+                class A {
+                    $kind func() { 'A' }
+                }
+                interface B {
+                    default func() { 'B' }
+                }
+                class C extends A implements B {
+                }
+
+                assert new C().func() == 'A'
+            """
+        }
+    }
 }

Reply via email to