Check JvmRecordSupport language feature before generating synthetic properties
This commit is contained in:
+5
-4
@@ -33,9 +33,10 @@ class DebuggerFieldExpressionCodegenExtension : ExpressionCodegenExtension {
|
||||
if (propertyDescriptor is JavaPropertyDescriptor) {
|
||||
val containingClass = propertyDescriptor.containingDeclaration as? JavaClassDescriptor
|
||||
if (containingClass != null) {
|
||||
val correspondingGetter = JavaSyntheticPropertiesScope(LockBasedStorageManager.NO_LOCKS, LookupTracker.DO_NOTHING)
|
||||
.getSyntheticExtensionProperties(listOf(containingClass.defaultType), NoLookupLocation.FROM_BACKEND)
|
||||
.firstOrNull { it.name == propertyDescriptor.name }
|
||||
val correspondingGetter =
|
||||
JavaSyntheticPropertiesScope(LockBasedStorageManager.NO_LOCKS, LookupTracker.DO_NOTHING, supportJavaRecords = true)
|
||||
.getSyntheticExtensionProperties(listOf(containingClass.defaultType), NoLookupLocation.FROM_BACKEND)
|
||||
.firstOrNull { it.name == propertyDescriptor.name }
|
||||
|
||||
if (correspondingGetter != null) {
|
||||
return c.codegen.intermediateValueForProperty(
|
||||
@@ -49,4 +50,4 @@ class DebuggerFieldExpressionCodegenExtension : ExpressionCodegenExtension {
|
||||
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.synthetic.JavaSyntheticPropertiesScope
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import java.lang.IllegalStateException
|
||||
|
||||
class DebuggerFieldKotlinIndicesHelperExtension : KotlinIndicesHelperExtension {
|
||||
override fun appendExtensionCallables(
|
||||
@@ -23,7 +22,8 @@ class DebuggerFieldKotlinIndicesHelperExtension : KotlinIndicesHelperExtension {
|
||||
nameFilter: (String) -> Boolean,
|
||||
lookupLocation: LookupLocation
|
||||
) {
|
||||
val javaPropertiesScope = JavaSyntheticPropertiesScope(LockBasedStorageManager.NO_LOCKS, LookupTracker.DO_NOTHING)
|
||||
val javaPropertiesScope =
|
||||
JavaSyntheticPropertiesScope(LockBasedStorageManager.NO_LOCKS, LookupTracker.DO_NOTHING, supportJavaRecords = true)
|
||||
val fieldScope = DebuggerFieldSyntheticScope(javaPropertiesScope)
|
||||
|
||||
for (property in fieldScope.getSyntheticExtensionProperties(receiverTypes, lookupLocation)) {
|
||||
@@ -41,4 +41,4 @@ class DebuggerFieldKotlinIndicesHelperExtension : KotlinIndicesHelperExtension {
|
||||
) {
|
||||
throw IllegalStateException("Should not be called")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user