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

Coercion in Method lookup should take generic ctors into account

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0-JSR-3
    • Component/s: None
    • Labels:
      None

      Description

      Test:
      import java.awt.Dimension

      def foo(Dimension d){}

      foo([100,200] as Dimension) // works
      Dimension d = [100,200]

      foo([100,200]) // throws MissingMethodException !

      Coercion from List to <type> triggers the generic ctor of <type> when used with 'as'
      or in assignments. This should also happen on coercions in the method lookup.

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              codevise Dierk K├Ânig
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: