报告未遵循样式指南中所建议顺序的修饰符。 如果存在注解和/或上下文形参,则证明修饰符位于它们后面,并且注解位于上下文形参前面。

对修饰符排序快速修复可用于自动修正代码。

示例:


  private inline fun correctOrder(f: () -> Unit) {} // <== Ok

  infix private fun Int.wrongOrder(expr: Int) {} // <== 顺序错误,快速修复会将修饰符修正为 "private infix"

    @Deprecated("message")
    context(str: String)
    private fun doThis() { } // <== Ok


    context(str: String)
    @Deprecated("message")
    fun doThis() { } // <== wrong order, quick-fix moves the annotation to the top