mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
Additional tests on reflection for Java methods
This commit is contained in:
25
compiler/testData/codegen/boxWithJava/reflection/javaMethodsSmokeTest/J.java
vendored
Normal file
25
compiler/testData/codegen/boxWithJava/reflection/javaMethodsSmokeTest/J.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import java.util.List;
|
||||
|
||||
public class J {
|
||||
void simple() {}
|
||||
|
||||
void objectTypes(
|
||||
Object o, String s, Object[] oo, String[] ss
|
||||
) {}
|
||||
|
||||
void primitives(
|
||||
boolean z, char c, byte b, short s, int i, float f, long j, double d
|
||||
) {}
|
||||
|
||||
void primitiveArrays(
|
||||
boolean[] z, char[] c, byte[] b, short[] s, int[] i, float[] f, long[] j, double[] d
|
||||
) {}
|
||||
|
||||
void multiDimensionalArrays(
|
||||
int[][][] i, Cloneable[][][][] c
|
||||
) {}
|
||||
|
||||
void wildcards(
|
||||
List<? extends Number> l, List<? super Cloneable> m
|
||||
) {}
|
||||
}
|
||||
17
compiler/testData/codegen/boxWithJava/reflection/javaMethodsSmokeTest/K.kt
vendored
Normal file
17
compiler/testData/codegen/boxWithJava/reflection/javaMethodsSmokeTest/K.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import kotlin.reflect.KFunction
|
||||
|
||||
// Initiate descriptor computation in reflection to ensure that nothing fails
|
||||
fun test(f: KFunction<*>) {
|
||||
f.parameters
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test(J::simple)
|
||||
test(J::objectTypes)
|
||||
test(J::primitives)
|
||||
test(J::primitiveArrays)
|
||||
test(J::multiDimensionalArrays)
|
||||
test(J::wildcards)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user