You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Protocols with default methods in extension fail to compile #562
If you have a protocol which has a default method implemented in an extension, the generated code will fail to compile because the Java compiler will complain about the extracted interface "is not abstract and does not override abstract method".
error: MyProtocol is not abstract and does not override abstract method myDefaultMethod() in MyProtocol
Instead we should not generate any methods, variables and initializers defined in extensions as part of the extracted interface. But we could generate them as default methods instead. This means we need to change the analysis phase to know what decls are defined in an extension and which come from the protocol requirements themselves.
Activity
ktoso commentedon Feb 13, 2026
Agreed, default methods is the way to go here. Thanks for reporting! Will you take a stab at it?
teamhimeh commentedon Nov 4, 2026
I faced almost the same issue and did a workaround in my fork. qoncept#2
Will #934 solve this issue?
Hokila commentedon Nov 4, 2026
#934 should fix the compilation error here.
It doesn't generate Java 8 default methods that forward to Swift implementations, though. My main goal in #934 was fixing the duplicate thunk issue