Fix ultra light structure for @JvmRecord classes
This commit is contained in:
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.resolve.annotations.JVM_STATIC_ANNOTATION_FQ_NAME
|
||||
import org.jetbrains.kotlin.resolve.annotations.argumentValue
|
||||
import org.jetbrains.kotlin.resolve.constants.EnumValue
|
||||
import org.jetbrains.kotlin.resolve.jvm.annotations.JVM_OVERLOADS_FQ_NAME
|
||||
import org.jetbrains.kotlin.resolve.jvm.annotations.JVM_RECORD_ANNOTATION_FQ_NAME
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny
|
||||
@@ -282,7 +283,8 @@ open class KtUltraLightClass(classOrObject: KtClassOrObject, internal val suppor
|
||||
parameter.isMutable,
|
||||
forceStatic = false,
|
||||
onlyJvmStatic = false,
|
||||
createAsAnnotationMethod = isAnnotationType
|
||||
createAsAnnotationMethod = isAnnotationType,
|
||||
isJvmRecord = classOrObject.hasAnnotation(JVM_RECORD_ANNOTATION_FQ_NAME),
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -509,4 +511,4 @@ open class KtUltraLightClass(classOrObject: KtClassOrObject, internal val suppor
|
||||
|
||||
return super.getTextRange()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -405,7 +405,8 @@ internal class UltraLightMembersCreator(
|
||||
mutable: Boolean,
|
||||
forceStatic: Boolean,
|
||||
onlyJvmStatic: Boolean,
|
||||
createAsAnnotationMethod: Boolean = false
|
||||
createAsAnnotationMethod: Boolean = false,
|
||||
isJvmRecord: Boolean = false,
|
||||
): List<KtLightMethod> {
|
||||
|
||||
val propertyName = declaration.name ?: return emptyList()
|
||||
@@ -454,7 +455,7 @@ internal class UltraLightMembersCreator(
|
||||
auxiliaryOriginalElement = auxiliaryOrigin
|
||||
)
|
||||
|
||||
val defaultGetterName = if (createAsAnnotationMethod) propertyName else JvmAbi.getterName(propertyName)
|
||||
val defaultGetterName = if (createAsAnnotationMethod || isJvmRecord) propertyName else JvmAbi.getterName(propertyName)
|
||||
val getterName = computeMethodName(auxiliaryOrigin, defaultGetterName, MethodType.GETTER)
|
||||
val getterPrototype = lightMethod(getterName, auxiliaryOrigin, forceStatic = onlyJvmStatic || forceStatic)
|
||||
val getterWrapper = KtUltraLightMethodForSourceDeclaration(
|
||||
|
||||
Reference in New Issue
Block a user