Describe the bug

While migrating to Kotlin 2.2, our OpenFeign calls stopped working. They were calling the default interface method instead of the OpenFeign proxy. It happens with the following versions: - Spring Boot: 3.5.7 - Spring Cloud: 2025.0.0 - Kotlin: 2.2.0 (broken) / 1.9.25 (working) - Java: 21 - Build Tool: Gradle 8.x with Kotlin DSL

Sample

I was able to write a complete reproducer (see commit history and README for full explanations): https://codeberg.org/Malt/reproducer-feign-jvm-default-kotlin-2-2

Workaround

As explained in the README, the -Xjvm-default=disable compiler option restores the correct behaviour.

Comment From: ryanjbaxter

I am not a Kolin expert by any means but we started managing the kotlin-maven-plugin in spring-cloud-build and moved to version 2.2 in 5.0.0 (main). I wonder if you can try that version of openfeign and see if there are any differences? https://github.com/spring-cloud/spring-cloud-build/commit/c5c70bf55da4d39c952af9ad1838912f5e2ae63a

Comment From: rouazana

I tried with the last version with this commit: https://codeberg.org/Malt/reproducer-feign-jvm-default-kotlin-2-2/commit/0838220b683da9ce98fbb0957f3594f437f41d5b

But the test is still failing. This is still the result from the default method that is returned.

Comment From: ryanjbaxter

I wonder if this might be the cause https://youtrack.jetbrains.com/issue/KT-71768

Can you try setting -Xjvm-default=disable?

Comment From: rouazana

Hello,

As indicated in my bug report, I can confirm that -Xjvm-default=disable is a suitable workaround 😄

Comment From: ryanjbaxter

Sorry I missed that. I am not sure what we can do then...again not a Kotlin expert, but if this is the default behavior with Kotlin the best we could do is document this.

Comment From: rouazana

I thought that by providing a full (and pretty atomic) reproducer it would make it easier to fix it.

This bug was pretty impactful for us when we encountered it, so I would prefer to solve it definitively. Maybe if you can provide me some guidance I can try to fix it.