Support KParameter.kind: instance, extension receiver, or value
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.KParameter.Kind.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class A {
|
||||
fun Int.foo(x: String) {}
|
||||
|
||||
inner class Inner(s: String) {}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val foo = A::class.memberExtensionFunctions.single()
|
||||
|
||||
assertEquals(listOf(INSTANCE, EXTENSION_RECEIVER, VALUE), foo.parameters.map { it.kind })
|
||||
assertEquals(listOf(INSTANCE, VALUE), A::Inner.parameters.map { it.kind })
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -3597,6 +3597,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kinds.kt")
|
||||
public void testKinds() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/parameters/kinds.kt");
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("propertySetter.kt")
|
||||
public void testPropertySetter() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/parameters/propertySetter.kt");
|
||||
|
||||
Reference in New Issue
Block a user