This is an automated email from the ASF dual-hosted git repository.

paulk 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 9eb60a5  GROOVY-9890: always search for default methods (additional 
test case)
9eb60a5 is described below

commit 9eb60a5a117c47a6a3dec7d24bae90268ff6f94b
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue May 18 10:13:49 2021 +1000

    GROOVY-9890: always search for default methods (additional test case)
---
 src/test/groovy/bugs/groovy9890/ImplJ.java         | 26 ++++++++++++++++++++++
 .../groovy/transform/stc/MethodCallsSTCTest.groovy | 11 +++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/test/groovy/bugs/groovy9890/ImplJ.java 
b/src/test/groovy/bugs/groovy9890/ImplJ.java
new file mode 100644
index 0000000..454bc4a
--- /dev/null
+++ b/src/test/groovy/bugs/groovy9890/ImplJ.java
@@ -0,0 +1,26 @@
+/*
+ *  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.groovy9890;
+
+public class ImplJ implements Face {
+    @Override
+    public Object foo(String s) {
+        return s;
+    }
+}
\ No newline at end of file
diff --git a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy 
b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
index 4c0f0d8..8931c42 100644
--- a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
@@ -1316,6 +1316,17 @@ class MethodCallsSTCTest extends 
StaticTypeCheckingTestCase {
         '''
     }
 
+    // GROOVY-9890
+    void testShouldFindInheritedInterfaceDefaultMethodJava() {
+        assertScript '''
+            void test() {
+                def result = new groovy.bugs.groovy9890.ImplJ().foo(42L)
+                assert result.class == Long.class
+            }
+            test()
+        '''
+    }
+
     // GROOVY-5743
     void testClosureAsParameter() {
         assertScript '''

Reply via email to