[ https://issues.apache.org/jira/browse/GROOVY-11168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767274#comment-17767274 ]
Eric Milles commented on GROOVY-11168: -------------------------------------- https://github.com/apache/groovy/commit/d9d2a830f54792ba0bc4abcaa12cfa2535993648 > Ability to `@DelegatesTo` the return type > ----------------------------------------- > > Key: GROOVY-11168 > URL: https://issues.apache.org/jira/browse/GROOVY-11168 > Project: Groovy > Issue Type: Improvement > Reporter: Björn Kautler > Assignee: Eric Milles > Priority: Major > Attachments: screenshot-1.png, screenshot-2.png > > > With a method > {code:java} > public <T> T Stub(Closure interactions); {code} > that is then used like > {code:java} > Foo foo = Stub { /* configure the foo here */ } {code} > I'd like to be able to specify that the delegate is of type {{T}} so in the > given example of type {{{}Foo{}}}. > Currently we do this in Spock via IDE-specific gdsl/dsld Scripts. > But it would be nice if this would be supported out of the box. > (Ideally in 2.5 already, as we still have a 2.5 compatible artifact. :)) -- This message was sent by Atlassian Jira (v8.20.10#820010)