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

Allow type checking extensions to handle ambiguous references to methods

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.0-beta-1
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      There are cases where the type checker wouldn't be able to determine what method is called based on arguments. There's currently no way to handle that with the standard type checking extension mechanism.

      Suggested DSL code:

      // resolve the ambiguous method by returning the one which has an Integer as parameter
      ambiguousMethods { methods, origin ->
          methods.find { it.parameters.any { it.type == classNodeFor(Integer) } }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              melix Cédric Champeau
              Reporter:
              melix Cédric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: