Skip to content

Filtering: Kotlin interface default implementations #978

@sellmair

Description

@sellmair

Scenario

  • JaCoCo version: 0.8.5
  • Operating system: MacOS
  • Tool integration: Gradle, Kotlin

Current Behaviour

Kotlin Interface default implementations like

interface SomeInterface {
    fun someFunction() = // Default implementation
}

Will lead to JaCoCo reporting uncovered functions for implementations of those interfaces:

class SomeImplementation: SomeInterface {

}

This is because of the Kotlin compiler effectively adding the default implementation to the compiled class like

public class SomeImplementation implements SomeInterface {
    
    public void someFunction() {
        DefaultImpls.someFunction(this)
    } 

}

Wanted Behaviour

I would like to have those default implementations ignored from JaCoCo. To cover those, it should be fine just to cover the default implementation once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions