Kotlin 2.2.0 interface method generation changes

27 views
Skip to first unread message

Zach Olbrys

unread,
Jun 27, 2025, 11:47:56 AMJun 27
to JaCoCo and EclEmma Users
Hey all,

When using JaCoCo 0.8.13 with Kotlin 2.2.0 code, I noticed that there are new interface methods that are marked as uncovered compared to Kotlin 2.1.21.

After doing some digging, I saw this called out in the Kotlin 2.2.0 changes:


And with the JvmDefaultMode.NO_COMPATIBILITY option it resolves the issues.

Here's an example:

`interface IMyMoviesViewModelProviderFactory : ViewModelProvider.Factory`

shows missing coverage on the default implementations of the `ViewModelProvider.Factory` interface (see attached image).

Additionally, for the implementation of this `IMyMoviesViewModelProviderFactory` interface, I only override the `public fun <T : ViewModel> create(modelClass: Class<T>)` method.  Coverage data shows that the class is missing coverage for the implementations of the other `ViewModelProvider.Factory` related methods, as I assume the default methods generated are being represented here.  I've attached a screenshot of this as well.

I admit I am not well versed in the tech stack here, in knowing how JaCoCo and/or Kotlin function - but it does seem like there's a disconnect with Kotlin 2.2.0 and JaCoCo coverage - does this seem like it's an issue on the JaCoCo side that needs to be closed out? Or should I report this on the Kotlin side?

Thanks all, open to hearing what you think!
Screenshot 2025-06-27 at 11.46.37.png
Screenshot 2025-06-27 at 11.43.25.png

Evgeny Mandrikov

unread,
Jun 27, 2025, 5:58:59 PMJun 27
to JaCoCo and EclEmma Users
Hi,

This case requires improvement on JaCoCo side - see https://github.com/jacoco/jacoco/issues/1905

Reply all
Reply to author
Forward
0 new messages