[
https://issues.apache.org/jira/browse/GROOVY-8722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569680#comment-16569680
]
ASF GitHub Bot commented on GROOVY-8722:
----------------------------------------
GitHub user paulk-asert opened a pull request:
https://github.com/apache/groovy/pull/780
GROOVY-8722: final modifier for non-abstract methods in traits is ign…
…ored
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/paulk-asert/groovy groovy8722
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/780.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #780
----
commit c472131950252d3da0329d24fade2897e8213ad4
Author: Paul King <paulk@...>
Date: 2018-08-06T02:51:14Z
GROOVY-8722: final modifier for non-abstract methods in traits is ignored
----
> final modifier for non-abstract methods in traits is ignored
> ------------------------------------------------------------
>
> Key: GROOVY-8722
> URL: https://issues.apache.org/jira/browse/GROOVY-8722
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Documentation
> Affects Versions: 2.4.15, 2.5.1
> Reporter: Dmytro Buryak
> Priority: Major
> Labels: documentation
>
> When using the {{final}} modifier in a trait non-abstract method signature,
> then:
> * compiler successfully compiles trait and class that implements it
> * final method of trait may be overridden in class that implements trait
> * if class implements trait and doesn't override trait final method, then
> this method is available as non-final method in class
> * documentation says absolutely nothing about this
> In other words, {{final}} modifier is ignored in trait methods: code works
> the same with or without it. Even if this behavior is expected, there's
> nothing about it in the documentation.
> Here's simple example gradle groovy project to demonstrate the issue:
> https://github.com/dburyak/groovy-bug-trait-final
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)