[ 
https://issues.apache.org/jira/browse/GROOVY-8659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18021163#comment-18021163
 ] 

ASF GitHub Bot commented on GROOVY-8659:
----------------------------------------

eric-milles merged PR #2294:
URL: https://github.com/apache/groovy/pull/2294




> 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
>
> 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)

Reply via email to