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 2022/03/17 20:13:00 UTC
[jira] [Resolved] (GROOVY-10494) Groovy 4 can not compile super.foo with generic interface (or trait) method
[ https://issues.apache.org/jira/browse/GROOVY-10494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10494.
----------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/301fef366dbf0aa7f1f30faeb9b14a07927fbd98
> Groovy 4 can not compile super.foo with generic interface (or trait) method
> ---------------------------------------------------------------------------
>
> Key: GROOVY-10494
> URL: https://issues.apache.org/jira/browse/GROOVY-10494
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.0
> Reporter: Xiaoguang Wang
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
> Attachments: image-2022-02-17-10-53-45-797.png, image-2022-02-17-10-56-36-832.png
>
>
> {code:java}
> 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")
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)