Description
package com.company.test import groovy.transform.CompileStatic @CompileStatic interface IService<T> { default void save(T entity) { System.out.println(entity); } } @CompileStatic interface IServiceString { default void save(String entity) { System.out.println(entity); } } @CompileStatic class TestGenericGroovy implements IService<String> { void save(String entity) { // IService<String>.super.save(entity) // works super.save(entity) // doesn't work: Groovyc: [Static type checking] - Abstract method save(T) cannot be called directly } static void main(String[] args) { new TestGenericGroovy().save("test") } }
Attachments
Attachments
Issue Links
- is related to
-
GROOVY-9909 Cannot call super when overriding an interface default method
- Closed
-
GROOVY-8299 Generate bytecode for interface with default, private and static methods
- Closed