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

Allow type checking extensions to handle ambiguous references to methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 2.2.0-beta-1
    • Static Type Checker
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: