groovy
  1. groovy
  2. GROOVY-6039

Allow type checking extensions to handle ambiguous references to methods

    Details

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

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

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: