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

@NamedVariant on extension method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5.2
    • None
    • None

    Description

      I have a method on Java interface

       

      RelationshipDefinition source(String cardinality, String title);

       

      And I want to create an extension method (as using @NamedVariant in Java sources is not supported)

       

      @NamedVariant
      static RelationshipDefinition source(RelationshipDefinition definition @NamedDelegate TitleAndCardinality tac) {
          return definition.source(tac.cardinality, tac.title)
      }

       

      I got an error when I try to use the method such as follows:

       

      definition.source(cardinality: '1')

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              musketyr Vladimír Oraný
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: