[
https://issues.apache.org/jira/browse/GROOVY-8659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-8659.
---------------------------------
Fix Version/s: 5.0.2
Resolution: Fixed
> Base class has final getter; extending class has property of same name; no
> warning for final override
> -----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-8659
> URL: https://issues.apache.org/jira/browse/GROOVY-8659
> Project: Groovy
> Issue Type: Question
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.2
>
>
> Possibly related to GROOVY-8188, this is more of a question than a bug at
> this point. Should it be an error to have a class extend another with a
> final method and provide a property of the same name?
> {code:groovy}
> class Foo {
> final Object getProp() {}
> }
> class Bar extends Foo {
> Object prop = 0; // Should this be a similar error?
> //Object getProp() {} // would be "You are not allowed to override the
> final method getProp() from class 'Foo'."
> }
> {code}
> Executing {{new Bar().prop}} returns null (from the final method); {{new
> Bar().@prop}} returns 0.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)