groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimír Oraný (JIRA) <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8879) @NamedVariant on extension method
Date Tue, 13 Nov 2018 07:53:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16684828#comment-16684828
] 

Vladimír Oraný commented on GROOVY-8879:
----------------------------------------

neither worked

 

[https://github.com/musketyr/yuml-dsl-builder/blob/named-arguments-problems/src/test/groovy/cz/orany/yuml/DiagramSpec.groovy#L78-L109]

> @NamedVariant on extension method
> ---------------------------------
>
>                 Key: GROOVY-8879
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8879
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.5.2
>            Reporter: Vladimír Oraný
>            Priority: Major
>
> I have a method on Java interface
>  
> {code:java}
> RelationshipDefinition source(String cardinality, String title);{code}
>  
> And I want to create an extension method (as using @NamedVariant in Java sources is not
supported)
>  
> {code:java}
> @NamedVariant
> static RelationshipDefinition source(RelationshipDefinition definition @NamedDelegate
TitleAndCardinality tac) {
>     return definition.source(tac.cardinality, tac.title)
> }{code}
>  
> I got an error when I try to use the method such as follows:
>  
> {code:java}
> definition.source(cardinality: '1'){code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message