Support loading Java records
^KT-43677 In Progress
This commit is contained in:
+8
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.descriptors.runtime.structure
|
||||
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaClass
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaClassifierType
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaRecordComponent
|
||||
import org.jetbrains.kotlin.load.java.structure.LightClassOriginKind
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
@@ -96,6 +97,9 @@ class ReflectJavaClass(
|
||||
.map(::ReflectJavaConstructor)
|
||||
.toList()
|
||||
|
||||
override val recordComponents: Collection<JavaRecordComponent>
|
||||
get() = emptyList()
|
||||
|
||||
override fun hasDefaultConstructor() = false // any default constructor is returned by constructors
|
||||
|
||||
override val lightClassOriginKind: LightClassOriginKind?
|
||||
@@ -114,6 +118,10 @@ class ReflectJavaClass(
|
||||
override val isEnum: Boolean
|
||||
get() = klass.isEnum
|
||||
|
||||
// TODO: Support reflect
|
||||
override val isRecord: Boolean
|
||||
get() = false
|
||||
|
||||
override fun equals(other: Any?) = other is ReflectJavaClass && klass == other.klass
|
||||
|
||||
override fun hashCode() = klass.hashCode()
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
||||
},
|
||||
""
|
||||
)
|
||||
LoadDescriptorUtil.compileJavaWithAnnotationsJar(sources, tmpdir)
|
||||
LoadDescriptorUtil.compileJavaWithAnnotationsJar(sources, tmpdir, emptyList(), null)
|
||||
}
|
||||
fileName.endsWith(".kt") -> {
|
||||
val environment = KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(
|
||||
|
||||
Reference in New Issue
Block a user