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 d13cb374f8 GROOVY-11613: add test case
d13cb374f8 is described below

commit d13cb374f83a535fbac454aa30083ef466d934f8
Author: Eric Milles <[email protected]>
AuthorDate: Sun Apr 13 10:30:20 2025 -0500

    GROOVY-11613: add test case
---
 src/test/groovy/bugs/Groovy11613.groovy | 45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy11613.groovy 
b/src/test/groovy/bugs/Groovy11613.groovy
new file mode 100644
index 0000000000..03a311dffc
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy11613.groovy
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+final class Groovy11613 {
+    @Test
+    void testInterfaceDefaultMethods() {
+        assertScript '''
+            interface Outer {
+                interface Inner extends Outer {
+                    default String foo() {
+                        'foo' + bar()
+                    }
+                }
+                default String bar() {
+                    'bar'
+                }
+            }
+
+            def object = new Outer.Inner() {}
+            def result = object.foo()
+            assert result == 'foobar'
+        '''
+    }
+}

Reply via email to