You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2019/01/05 16:33:00 UTC
[jira] [Assigned] (GROOVY-8947) Fail to resolve non-static inner
class outside of outer class
[ https://issues.apache.org/jira/browse/GROOVY-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun reassigned GROOVY-8947:
----------------------------------
Assignee: Daniel Sun
> Fail to resolve non-static inner class outside of outer class
> -------------------------------------------------------------
>
> Key: GROOVY-8947
> URL: https://issues.apache.org/jira/browse/GROOVY-8947
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha-4
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 3.0.0-alpha-5
>
>
> {code:java}
> public class Computer {
> public class Cpu {
> int coreNumber
> public Cpu(int coreNumber) {
> this.coreNumber = coreNumber
> }
> }
> public static newInstance() {
> return new Computer().new Cpu(4)
> }
> }
> assert 4 == new Computer().new Cpu(4).coreNumber // unable to resolve class Cpu
> // assert 4 == Computer.newInstance().coreNumber // resolve class Cpu successfully
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)