Skip to content

False positive reported by ModifierOrder when using fun interfaces #3050

Closed
@chao2zhang

Description

@chao2zhang

Expected Behavior

A code snippet like the following is using the Kotlin SAM introduced in Kotlin 1.4

    internal fun interface LoadMoreCallback {
        fun loadMore()
    }

This should pass the detekt check

Observed Behavior

We got a ModifierOrder issue with the error message "Modifier order should be: fun internal".

Context

We have recently upgraded our codebase to use Kotlin 1.4, there is only one occurrence so we can suppress it to unblock us.

Your Environment

Version of detekt used: 1.12.0
Version of Gradle used (if applicable): 6.6.1
Operating System and version: macOS Catalina 10.15.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions