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

Coercion in Method lookup should take generic ctors into account

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-2
    • 1.0-JSR-3
    • None
    • 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

            blackdrag Jochen Theodorou
            codevise Dierk König
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: