You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/11/26 18:10:00 UTC
[jira] [Assigned] (GROOVY-10380) SC: IncompatibleClassChangeError when calling interface default method from non-public interface
[ https://issues.apache.org/jira/browse/GROOVY-10380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-10380:
------------------------------------
Assignee: Eric Milles
> SC: IncompatibleClassChangeError when calling interface default method from non-public interface
> ------------------------------------------------------------------------------------------------
>
> Key: GROOVY-10380
> URL: https://issues.apache.org/jira/browse/GROOVY-10380
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Labels: default-methods
>
> Consider the following:
> {code:java}
> package p;
> interface I {
> default void m() {
> System.out.println("works");
> }
> }
> public abstract class A implements I { // or concrete or implemented in groovy
> }
> {code}
> {code:groovy}
> // not in package p
> @groovy.transform.CompileStatic // works if CompileDynamic or TypeChecked
> class C extends p.A {
> void test() {
> m() // IncompatibleClassChangeError: Found class C, but interface was expected
> }
> }
> {code}
> In the case of a non-public interface with a public default method, static compilation produces a runtime error that is not present for dynamic groovy or java.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)