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/09/04 11:54:00 UTC
[jira] [Resolved] (GROOVY-9243) Fail to resolve nested type defined
in base type written in Groovy
[ https://issues.apache.org/jira/browse/GROOVY-9243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun resolved GROOVY-9243.
--------------------------------
Resolution: Fixed
Fixed by https://github.com/apache/groovy/commit/89c4dfa95777fb40af362730f12a81f9daf863b8
> Fail to resolve nested type defined in base type written in Groovy
> ------------------------------------------------------------------
>
> Key: GROOVY-9243
> URL: https://issues.apache.org/jira/browse/GROOVY-9243
> Project: Groovy
> Issue Type: Bug
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 3.0.0-beta-4
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> *file Base.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Base {
> static class X {}
> }
> {code}
> *file Main.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Groovy9243 extends Base {
> def accessX() {
> assert new X()
> }
> }
> new Groovy9243().accessX()
> {code}
> compile Main.groovy with groovyc: {{unable to resolve class X}}
> Here is a workaround:
> *file Main.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Groovy9243 extends Base {
> def accessX() {
> assert new Base.X() // qualify the type name
> }
> }
> new Groovy9243().accessX()
> {code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)