Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Throwing a descriptive error upon encountering inline function #1030

@diastremskii

Description

@diastremskii

Inline functions are not supported as mentioned in README and here. Currently, when mocking behaviour of the inline function, the body of the function ("real" implementation) starts to execute, leading to errors that are difficult to debug and pinpoint to mockk (or the function itself being inline). It would be great to have a fail-fast approach, where Mockk would fail right away with an error when trying to mock an inline function.

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

Encountering a meaningful error describing that mocking inline functions isn't supported.

Current Behavior

When mocking, code of the inline function (actual one, not the mocked one) starts to execute with unpredictable and hard-to-debug consequences.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions