Skip to content

Support default parameters #201

@anthonycr

Description

@anthonycr

Given an interface

interface DefaultParameters {
    fun function(parameter: String = "default")
}

Mockingbird cannot transform the following code:

verify(defaultParameters) {
    defaultParameters.function()
}

This is because Mockingbird cannot "see" the value of the default parameter, and thus cannot determine what value to check for equality. In version 2.x, default parameters worked because Mockingbird did the verification inside the class itself. Since the verification is performed at the callsite, this is not supported in 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions