Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/resolve/adaptedReferenceAgainstKCallable.kt
T
Mikhail Zarechenskiy 0c79de1a98 Prohibit adapted reference resolve against reflective types
There are design questions about reflection for adapted references,
 so the current proposal is to prohibit reflection on them and support
 it properly later

 #KT-40406 Fixed
2020-07-20 14:30:39 +03:00

13 lines
231 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: -AdaptedCallableReferenceAgainstReflectiveType
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KCallable
fun take(k: KCallable<*>) {}
fun foo(x: Int = 0) {}
fun test() {
take(::foo)
}