Cleanup: apply "Use synthetic property access syntax"
This commit is contained in:
+1
-1
@@ -403,7 +403,7 @@ class ExpressionCodegen(
|
||||
val spreadBuilderClassName = AsmUtil.asmPrimitiveTypeToLangPrimitiveType(elementType)!!.typeName.identifier + "SpreadBuilder"
|
||||
owner = "kotlin/jvm/internal/" + spreadBuilderClassName
|
||||
addDescriptor = "(" + elementType.descriptor + ")V"
|
||||
toArrayDescriptor = "()" + type.getDescriptor()
|
||||
toArrayDescriptor = "()" + type.descriptor
|
||||
}
|
||||
mv.anew(Type.getObjectType(owner))
|
||||
mv.dup()
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ class FunctionCodegen(val irFunction: IrFunction, val classCodegen: ClassCodegen
|
||||
val defaultValue = this
|
||||
val constant = org.jetbrains.kotlin.codegen.ExpressionCodegen.getCompileTimeConstant(
|
||||
defaultValue, state.bindingContext, true, state.shouldInlineConstVals)
|
||||
assert(!state.classBuilderMode.generateBodies || constant != null) { "Default value for annotation parameter should be compile time value: " + defaultValue.getText() }
|
||||
assert(!state.classBuilderMode.generateBodies || constant != null) { "Default value for annotation parameter should be compile time value: " + defaultValue.text }
|
||||
if (constant != null) {
|
||||
val annotationCodegen = AnnotationCodegen.forAnnotationDefaultValue(methodVisitor, classCodegen, state.typeMapper)
|
||||
annotationCodegen.generateAnnotationDefaultValue(constant, descriptor.returnType!!)
|
||||
|
||||
@@ -212,7 +212,7 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator
|
||||
primaryConstructorDescriptor)
|
||||
|
||||
val bodyGenerator = BodyGenerator(primaryConstructorDescriptor, context)
|
||||
ktClassOrObject.getPrimaryConstructor()?.valueParameterList?.let { ktValueParameterList ->
|
||||
ktClassOrObject.primaryConstructor?.valueParameterList?.let { ktValueParameterList ->
|
||||
bodyGenerator.generateDefaultParameters(ktValueParameterList, irPrimaryConstructor)
|
||||
}
|
||||
irPrimaryConstructor.body = bodyGenerator.generatePrimaryConstructorBody(ktClassOrObject)
|
||||
@@ -221,7 +221,7 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator
|
||||
}
|
||||
|
||||
private fun generatePropertiesDeclaredInPrimaryConstructor(irClass: IrClassImpl, ktClassOrObject: KtClassOrObject) {
|
||||
ktClassOrObject.getPrimaryConstructor()?.let { ktPrimaryConstructor ->
|
||||
ktClassOrObject.primaryConstructor?.let { ktPrimaryConstructor ->
|
||||
for (ktParameter in ktPrimaryConstructor.valueParameters) {
|
||||
if (ktParameter.hasValOrVar()) {
|
||||
val irProperty = PropertyGenerator(declarationGenerator).generatePropertyForPrimaryConstructorParameter(ktParameter)
|
||||
|
||||
Reference in New Issue
Block a user