You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/09/20 06:30:00 UTC
[jira] [Resolved] (GROOVY-9672) trait conflict resolution not
available for static methods
[ https://issues.apache.org/jira/browse/GROOVY-9672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-9672.
-------------------------------
Fix Version/s: 3.0.6
4.0.0-alpha-1
Resolution: Fixed
> trait conflict resolution not available for static methods
> ----------------------------------------------------------
>
> Key: GROOVY-9672
> URL: https://issues.apache.org/jira/browse/GROOVY-9672
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 4.0.0-alpha-1, 3.0.6
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> If the case mentioned in https://docs.groovy-lang.org/latest/html/documentation/#_default_conflict_resolution used static methods instead of instance methods, "T.super.m()" disambiguation is not available.
> Consider the following:
> {code:groovy}
> trait A {
> static m() { 'A' }
> }
> trait B {
> static m() { 'B' }
> }
> class C implements A, B {
> void test() {
> print m() // prints "B"
> print A.super.m() // java.lang.IllegalArgumentException or some other compiler problem
> print B.super.m() // java.lang.IllegalArgumentException or some other compiler problem
> }
> }
> new C().test()
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)