Skip to content

Ambiguous overload of ObjectAssert extracting with Kotlin since 3.27.0. #3728

@wilkinsona

Description

@wilkinsona

Describe the bug
The change made in #3673 (I think) causes a compilation problem with Kotlin due to ambiguous overloading of extracting on ObjectAssert. The failure is as follows:

> Task :spring-boot-project:spring-boot-docs:compileKotlin
e: file:///Users/awilkinson/dev/spring-projects/spring-boot/main/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredwebservices/client/MyWebServiceClientTests.kt:36:42 Overload resolution ambiguity: 
public open fun <T : Any!> extracting(extractor: Function<in Response!, TypeVariable(T)!>!): AbstractObjectAssert<*, TypeVariable(T)!>! defined in org.assertj.core.api.ObjectAssert
public final fun <T : Any!> extracting(vararg extractors: Function<in Response!, out TypeVariable(T)!>!): AbstractListAssert<*, (MutableList<out TypeVariable(T)!>..List<TypeVariable(T)!>?), TypeVariable(T)!, ObjectAssert<TypeVariable(T)!>!>! defined in org.assertj.core.api.ObjectAssert
  • assertj core version: 3.27.2
  • java version: 17 (but it's not Java-version-specific)
  • test framework version: N/A
  • os (if relevant): N/A

Test case reproducing the bug

I can provide some Kotlin source that fails to compile if needed. You can already see an example here.

Metadata

Metadata

Assignees

Labels

language: KotlinAn issue related to using AssertJ with Kotlin

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions