Saravanan created GROOVY-11613:
----------------------------------

             Summary: Cannot call on outerclass's default method if the inner 
class extends that outerclass
                 Key: GROOVY-11613
                 URL: https://issues.apache.org/jira/browse/GROOVY-11613
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 4.0.24
            Reporter: Saravanan


 
{code:java}
public interface Interfaces {
    default String myThing() {
        return "BLAHG"
    }    

    // Groovy fails with Cannot have non-static inner class 
    // inside a trait (com.org.interfaces.Interfaces$Inner)
    // Does not fare better if we add static. Works with abstract classes
    public interface Inner extends Interfaces {
        default String otherThing() {
           return myThing()
        }
    }
} {code}

The first error I get is that inner classes in a trait cannot be non static. 
But if I make it static, I get a null pointer exception looking for the trait 
helper class (because the trait's helper class was not created yet when parsing 
the inner class)

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to