You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/07/18 12:17:00 UTC

[jira] [Resolved] (GROOVY-9642) Inner interface of parent class unresolved in anon. inner class expression

     [ https://issues.apache.org/jira/browse/GROOVY-9642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-9642.
-------------------------------
    Fix Version/s: 2.5.13
                   3.0.5
                   4.0.0-alpha-1
       Resolution: Fixed

Proposed PR merged. Thanks.

> Inner interface of parent class unresolved in anon. inner class expression
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-9642
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9642
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.4
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 4.0.0-alpha-1, 3.0.5, 2.5.13
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Consider the following:
> A.java
> {code:java}
> package p;
> public class A {
>   public interface I {
>   }
> }
> {code}
> B.groovy
> {code:groovy}
> package q
> import p.A
> class B extends A {
>   static I maker() {
>     return new I() {} // error: unable to resolve class I
>   }
> }
> {code}
> The inner class "I" can be resolved for return type and class/variable expression (see GROOVY-8364).  However the anonymous inner class usage is reporting an error.  If "I" were a static inner class, it could be used in constructor call expression "new T()" but fails for "new T() {}".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)