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 2023/10/24 13:57:00 UTC
[jira] [Assigned] (GROOVY-11204) Incorrect overload selection for subclasses
[ https://issues.apache.org/jira/browse/GROOVY-11204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-11204:
------------------------------------
Assignee: Eric Milles
> Incorrect overload selection for subclasses
> -------------------------------------------
>
> Key: GROOVY-11204
> URL: https://issues.apache.org/jira/browse/GROOVY-11204
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.12
> Reporter: Christopher Smith
> Assignee: Eric Milles
> Priority: Major
>
> I'm writing a Spring Security 6.2 configurer and trying to add it to my configuration using {{apply(C)}}, but the Groovy compiler selects the wrong overload, and necessary initialization is not performed.
> {code:groovy}
> // AbstractHttpConfigurer extends SecurityConfigurerAdapter
> class MyConfigurer extends AbstractHttpConfigurer<MyConfigurer, HttpSecurity> {}
> // configuration
> @Bean
> SecurityFilterChain securityFilterChain(HttpSecurity http) {
> http.apply(new MyConfigurer())
> // ^ should select apply(SecurityConfigurerAdapter), but selects apply(SecurityConfigurer)
> .and()
> .build()
> }
> {code}
> This is probably a result of an edge case in the generics, since the bounds on the overloads are determined by type parameters.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)