mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Fix supertypes for reflected Java classes, always include j.l.Object
equals/hashCode/toString had not appeared in Java classes' "members" because of this
This commit is contained in:
10
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions/J.java
vendored
Normal file
10
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions/J.java
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
public class J {
|
||||
public J() {
|
||||
}
|
||||
|
||||
public void member(String s) {
|
||||
}
|
||||
|
||||
public static void staticMethod(int x) {
|
||||
}
|
||||
}
|
||||
12
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions/K.kt
vendored
Normal file
12
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions/K.kt
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import kotlin.reflect.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.members.map { it.name }.toSortedList())
|
||||
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.functions.map { it.name }.toSortedList())
|
||||
assertEquals(listOf("member", "staticMethod"), J::class.declaredFunctions.map { it.name }.toSortedList())
|
||||
|
||||
assertEquals(1, J::class.constructors.size())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user