GenericConversionService cannot find a converter when converting to a Kotlin list of maps #34535
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
This test works fine in Spring 6.2.2 but fails in 6.2.3.
It is probably related to this fix: #34298.
Exception:
After a brief investigation, we found that this issue may be related to Kotlin declaration-site variance. Kotlin's
List
is declared with<out E>
:As a result,
Converter<String, List<Map<String, Any>>>
compiles to something likeConverter<String, List<? extends Map<String, ?>>>
. The fix introduced in #34298 makes this converter incompatible with the target typeList<String, Map<?, ?>>
.As a workaround we replaced Kotlin's
List
with Java equivalent in the converter declaration. The following converter works correctly:The text was updated successfully, but these errors were encountered: