Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8269

Unclear/incorrect definition of default behavior for trait multiple inheritence conflicts

    Details

    • Type: Documentation
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.12
    • Fix Version/s: 2.4.13
    • Component/s: Documentation
    • Labels:
      None

      Description

      In section 2.10.1, Default conflict resolution, the text says "In this case, the default behavior is that methods from the last declared trait wins", when in fact the order they are implemented is what decides the winning method (and if this is what the wording was intending to say, then it isn't clear because the example has trait B declared after trait A as well as C implementing B after A).

      1. problem.png
        29 kB
        Sasha Volokh

        Issue Links

          Activity

          Hide
          paulk Paul King added a comment -

          I haven't had time to check yet but if you can include which Groovy version(s) you are using, that would be great. Thanks.

          Show
          paulk Paul King added a comment - I haven't had time to check yet but if you can include which Groovy version(s) you are using, that would be great. Thanks.
          Hide
          sashavol Sasha Volokh added a comment -

          Added the version number.

          Show
          sashavol Sasha Volokh added a comment - Added the version number.
          Hide
          jwagenleitner John Wagenleitner added a comment -

          Would adding a reference to the implements clause help make it more clear?

          In this case, the default behavior is that the method from the last declared trait in the implements clause wins.

          Show
          jwagenleitner John Wagenleitner added a comment - Would adding a reference to the implements clause help make it more clear? In this case, the default behavior is that the method from the last declared trait in the implements clause wins.
          Hide
          sashavol Sasha Volokh added a comment -

          Yeah, that'd be great.

          Show
          sashavol Sasha Volokh added a comment - Yeah, that'd be great.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user jwagenleitner opened a pull request:

          https://github.com/apache/groovy/pull/582

          GROOVY-8269: Unclear definition of default behavior for trait multipl…

          …e inheritance conflicts

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/jwagenleitner/groovy 8269-trait-conflict-doc

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/groovy/pull/582.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 #582


          commit ca3a10c1e22be899bcd8534a7aee4f5bdaf197d2
          Author: John Wagenleitner <jwagenleitner@apache.org>
          Date: 2017-08-13T19:07:33Z

          GROOVY-8269: Unclear definition of default behavior for trait multiple inheritance conflicts


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user jwagenleitner opened a pull request: https://github.com/apache/groovy/pull/582 GROOVY-8269 : Unclear definition of default behavior for trait multipl… …e inheritance conflicts You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/groovy 8269-trait-conflict-doc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/582.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 #582 commit ca3a10c1e22be899bcd8534a7aee4f5bdaf197d2 Author: John Wagenleitner <jwagenleitner@apache.org> Date: 2017-08-13T19:07:33Z GROOVY-8269 : Unclear definition of default behavior for trait multiple inheritance conflicts
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/groovy/pull/582

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/582
          Hide
          jwagenleitner John Wagenleitner added a comment -

          Thanks for reporting the issue. I made the change to mention the implements clause. PR's welcomed if there are any additional changes that would be helpful.

          Show
          jwagenleitner John Wagenleitner added a comment - Thanks for reporting the issue. I made the change to mention the implements clause. PR's welcomed if there are any additional changes that would be helpful.

            People

            • Assignee:
              jwagenleitner John Wagenleitner
              Reporter:
              sashavol Sasha Volokh
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development