[
https://issues.apache.org/jira/browse/GROOVY-12301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108287#comment-18108287
]
ASF GitHub Bot commented on GROOVY-12301:
-----------------------------------------
testlens-app[bot] commented on PR #2833:
URL: https://github.com/apache/groovy/pull/2833#issuecomment-5425081475
## ✅ All tests passed ✅
🏷️ Commit: 22c0cdd05fb6e6841871c576589a276bd622f1fa
▶️ Tests: 113257 executed
⚪️ Checks: 31/31 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> 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)