c322644860
During the fix of KT-62525, we've forbidden to use lambda parameters with inaccessible types at all. After it, some impact was noticed, so we decided to forbid them only in case it's necessary (the case when associated types have type arguments, see KT-62525 description), and to deprecate them in other cases. #KT-64266 Fixed
31 lines
588 B
Kotlin
Vendored
31 lines
588 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
|
|
// LANGUAGE: +ForbidLambdaParameterWithMissingDependencyType
|
|
// ISSUE: KT-64266
|
|
|
|
// MODULE: m1
|
|
// FILE: m1.kt
|
|
|
|
class Some
|
|
|
|
// MODULE: m2(m1)
|
|
// FILE: m2.kt
|
|
|
|
fun foo(f: (Some, String) -> Unit) {}
|
|
fun bar(f: (Some) -> Unit) {}
|
|
|
|
// MODULE: m3(m2)
|
|
// FILE: m3.kt
|
|
|
|
fun test() {
|
|
foo { _, _ -> }
|
|
foo { some, str -> }
|
|
foo { some, _ -> some.toString() }
|
|
foo { some: <!UNRESOLVED_REFERENCE!>Some<!>, _ -> }
|
|
|
|
bar { }
|
|
bar { _ -> }
|
|
bar { it -> }
|
|
bar { it.toString() }
|
|
bar { some -> some.toString() }
|
|
}
|