You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/05/10 17:10:00 UTC

[jira] [Updated] (GROOVY-10619) STC: fix support for unbounded wildcard references to self-bounded type parameters

     [ https://issues.apache.org/jira/browse/GROOVY-10619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-10619:
---------------------------------
    Labels: generics  (was: )

> STC: fix support for unbounded wildcard references to self-bounded type parameters
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-10619
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10619
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 4.0.2
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: generics
>
> {code:groovy}
> @Grab('org.springframework.boot:spring-boot-starter-webflux:2.6.7')
> import org.springframework.core.ParameterizedTypeReference
> import org.springframework.http.MediaType
> import org.springframework.web.reactive.function.client.WebClient
> import java.time.Duration
> @groovy.transform.CompileStatic
> class WebFluxFluentApiBugTest {
>   private static final ParameterizedTypeReference<List<BigDecimal>> TYPE_TAG
>     = new ParameterizedTypeReference<List<BigDecimal>>() {}
>   private static final Duration MAX_DURATION = Duration.ofSeconds(8)
>   private final WebClient webClient
>   List<BigDecimal> flux() {
>     def response = webClient.get()
>       .uri('/something?id={id}', 'id')
>       .accept(MediaType.APPLICATION_JSON)
>       .retrieve()
>       .toEntity(TYPE_TAG)
>       .block(MAX_DURATION)
>     return response.getBody() ?: []
>   }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)