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

ASF GitHub Bot commented on GROOVY-12301:
-----------------------------------------

paulk-asert merged PR #2833:
URL: https://github.com/apache/groovy/pull/2833




> STC does not resolve generic return type properly
> -------------------------------------------------
>
>                 Key: GROOVY-12301
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12301
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0-alpha-1, 5.0.3, 4.0.31
>            Reporter: Björn Kautler
>            Priority: Major
>
> Given this snippet:
> {code:java}
> @Grab('org.jboss.weld:weld-spock:4.0.4.Final')
> import org.jboss.weld.spock.WeldInitiator
> import org.jboss.weld.spock.WeldInitiator.Builder
>   
> @groovy.transform.CompileStatic
> class Foo {
>   def foo() {
>     Builder builder = 
> WeldInitiator.from(WeldInitiator.createWeld()).inject(this)
>     println(builder)
>   }
> }
> new Foo().foo() {code}
> STC complains
> {code:java}
> Cannot assign value of type 
> org.jboss.weld.junit.AbstractWeldInitiator$AbstractBuilder to variable of 
> type org.jboss.weld.spock.WeldInitiator$Builder {code}
> IntelliJ knows the type of the {{inject}} result properly as {{{}Builder{}}}, 
> and in Java it also compiles fine.
> (This time I verified it still happens in 6.0.0-alpha-1 which is available in 
> groovyconsole.dev :))



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to