Daniel Sun created GROOVY-12803:
-----------------------------------

             Summary: Creating a non-static inner class as new Outer.Inner() 
without an outer instance is not a compile error
                 Key: GROOVY-12803
                 URL: https://issues.apache.org/jira/browse/GROOVY-12803
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
            Reporter: Daniel Sun


gls.innerClass.InnerClassTest#testNonStaticInnerClass3 in 
src/test/groovy/gls/innerClass/InnerClassTest.groovy is @NotYetImplemented and 
has no issue key. It expects

  def x = new A.B()

to fail compilation when B is a non-static inner class of A (Java requires an 
enclosing instance). Groovy currently appears to accept this, or at least not 
to fail in the way the test expects (shouldFail CompilationFailedException).

No open ticket was found that describes this exact gap. GROOVY-9781 is a 
different inner-class constructor issue (map / named-arg construction) and is 
already reopened; this ticket should not be folded into it.

Scanned SHA: ca71425976fd2e3da6db9634955ba0d39550a6d4 (apache/groovy master).

Acceptance criterion: new A.B() without an enclosing A is a compile error, the 
test passes, and @NotYetImplemented is removed.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to