IR make 'name' a var
This commit is contained in:
@@ -57,8 +57,11 @@ class Fir2IrLazyClass(
|
||||
override val descriptor: ClassDescriptor
|
||||
get() = symbol.descriptor
|
||||
|
||||
override val name: Name
|
||||
override var name: Name
|
||||
get() = fir.name
|
||||
set(_) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
@Suppress("SetterBackingFieldAssignment")
|
||||
override var visibility: DescriptorVisibility = components.visibilityConverter.convertToDescriptorVisibility(fir.visibility)
|
||||
|
||||
@@ -63,8 +63,11 @@ class Fir2IrLazyConstructor(
|
||||
|
||||
override var body: IrBody? = null
|
||||
|
||||
override val name: Name
|
||||
override var name: Name
|
||||
get() = SpecialNames.INIT
|
||||
set(_) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
@Suppress("SetterBackingFieldAssignment")
|
||||
override var visibility: DescriptorVisibility = components.visibilityConverter.convertToDescriptorVisibility(fir.visibility)
|
||||
|
||||
@@ -74,8 +74,11 @@ class Fir2IrLazyProperty(
|
||||
override val isExpect: Boolean
|
||||
get() = fir.isExpect
|
||||
|
||||
override val name: Name
|
||||
override var name: Name
|
||||
get() = fir.name
|
||||
set(_) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
@Suppress("SetterBackingFieldAssignment")
|
||||
override var visibility: DescriptorVisibility = components.visibilityConverter.convertToDescriptorVisibility(fir.visibility)
|
||||
|
||||
@@ -52,8 +52,11 @@ class Fir2IrLazyPropertyAccessor(
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
override val name: Name
|
||||
override var name: Name
|
||||
get() = Name.special("<${if (isSetter) "set" else "get"}-${firParentProperty.name}>")
|
||||
set(_) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override var returnType: IrType by lazyVar(lock) {
|
||||
if (isSetter) irBuiltIns.unitType else firParentProperty.returnTypeRef.toIrType(typeConverter, conversionTypeContext)
|
||||
|
||||
@@ -41,8 +41,11 @@ class Fir2IrLazySimpleFunction(
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
override val name: Name
|
||||
override var name: Name
|
||||
get() = fir.name
|
||||
set(_) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override var returnType: IrType by lazyVar(lock) {
|
||||
fir.returnTypeRef.toIrType(typeConverter)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ open class IrClassImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
final override val symbol: IrClassSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val kind: ClassKind,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override var modality: Modality,
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class IrConstructorImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrConstructorSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
returnType: IrType,
|
||||
override val isInline: Boolean,
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class IrEnumEntryImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrEnumEntrySymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrEnumEntry() {
|
||||
init {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class IrFieldImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrFieldSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var type: IrType,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val isFinal: Boolean,
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ abstract class IrFunctionCommonImpl(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
returnType: IrType,
|
||||
override val isInline: Boolean,
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class IrLocalDelegatedPropertyImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrLocalDelegatedPropertySymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var type: IrType,
|
||||
override val isVar: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ abstract class IrPropertyCommonImpl(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val isVar: Boolean,
|
||||
override val isConst: Boolean,
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class IrTypeAliasImpl(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
override val symbol: IrTypeAliasSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override var expandedType: IrType,
|
||||
override val isActual: Boolean,
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class IrTypeParameterImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrTypeParameterSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val index: Int,
|
||||
override val isReified: Boolean,
|
||||
override val variance: Variance,
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class IrValueParameterImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrValueParameterSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val index: Int,
|
||||
override var type: IrType,
|
||||
override var varargElementType: IrType?,
|
||||
|
||||
+1
-1
@@ -8,5 +8,5 @@ package org.jetbrains.kotlin.ir.declarations
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
interface IrDeclarationWithName : IrDeclaration {
|
||||
val name: Name
|
||||
var name: Name
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ private val SCRIPT_ORIGIN = object : IrDeclarationOriginImpl("SCRIPT") {}
|
||||
|
||||
class IrScriptImpl(
|
||||
override val symbol: IrScriptSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val factory: IrFactory,
|
||||
) : IrScript() {
|
||||
override val startOffset: Int get() = UNDEFINED_OFFSET
|
||||
|
||||
@@ -33,7 +33,7 @@ class IrVariableImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrVariableSymbol,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var type: IrType,
|
||||
override val isVar: Boolean,
|
||||
override val isConst: Boolean,
|
||||
|
||||
@@ -25,7 +25,7 @@ class IrLazyClass(
|
||||
override val symbol: IrClassSymbol,
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override val descriptor: ClassDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val kind: ClassKind,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override var modality: Modality,
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class IrLazyConstructor(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrConstructorSymbol,
|
||||
override val descriptor: ClassConstructorDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val isInline: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ class IrLazyEnumEntryImpl(
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
override val name: Name = descriptor.name
|
||||
override var name: Name = descriptor.name
|
||||
|
||||
override var correspondingClass: IrClass? = null
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class IrLazyField(
|
||||
override val symbol: IrFieldSymbol,
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override val descriptor: PropertyDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val isFinal: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
|
||||
@@ -31,7 +31,7 @@ class IrLazyFunction(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrSimpleFunctionSymbol,
|
||||
override val descriptor: FunctionDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val modality: Modality,
|
||||
override val isInline: Boolean,
|
||||
|
||||
@@ -25,7 +25,7 @@ class IrLazyProperty(
|
||||
override val symbol: IrPropertySymbol,
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override val descriptor: PropertyDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val modality: Modality,
|
||||
override val isVar: Boolean,
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class IrLazyTypeAlias(
|
||||
override val symbol: IrTypeAliasSymbol,
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override val descriptor: TypeAliasDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override var visibility: DescriptorVisibility,
|
||||
override val isActual: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class IrLazyTypeParameter(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrTypeParameterSymbol,
|
||||
override val descriptor: TypeParameterDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val index: Int,
|
||||
override val isReified: Boolean,
|
||||
override val variance: Variance,
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ class IrLazyValueParameter(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrValueParameterSymbol,
|
||||
override val descriptor: ValueParameterDescriptor,
|
||||
override val name: Name,
|
||||
override var name: Name,
|
||||
override val index: Int,
|
||||
kotlinType: KotlinType,
|
||||
varargElementKotlinType: KotlinType?,
|
||||
|
||||
Reference in New Issue
Block a user