Cleanup: apply "lift out..." inspection (+ some others)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0c41ceea9d
commit
9c06739594
+3
-3
@@ -65,11 +65,11 @@ class ConstAndJvmFieldPropertiesLowering : IrElementTransformerVoid(), FileLower
|
||||
|
||||
val property = descriptor.correspondingProperty
|
||||
if (JvmCodegenUtil.isConstOrHasJvmFieldAnnotation(property)) {
|
||||
if (descriptor is PropertyGetterDescriptor) {
|
||||
return substituteGetter(descriptor, expression)
|
||||
return if (descriptor is PropertyGetterDescriptor) {
|
||||
substituteGetter(descriptor, expression)
|
||||
}
|
||||
else {
|
||||
return substituteSetter(descriptor, expression)
|
||||
substituteSetter(descriptor, expression)
|
||||
}
|
||||
}
|
||||
else if (property is SyntheticJavaPropertyDescriptor) {
|
||||
|
||||
+5
-5
@@ -141,23 +141,23 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
|
||||
}
|
||||
|
||||
private fun generateWhenBody(expression: KtWhenExpression, irSubject: IrVariable?, irWhen: IrWhen): IrExpression {
|
||||
if (irSubject == null) {
|
||||
return if (irSubject == null) {
|
||||
if (irWhen.branches.isEmpty())
|
||||
return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN)
|
||||
IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN)
|
||||
else
|
||||
return irWhen
|
||||
irWhen
|
||||
}
|
||||
else {
|
||||
if (irWhen.branches.isEmpty()) {
|
||||
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN)
|
||||
irBlock.statements.add(irSubject)
|
||||
return irBlock
|
||||
irBlock
|
||||
}
|
||||
else {
|
||||
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irWhen.type, IrStatementOrigin.WHEN)
|
||||
irBlock.statements.add(irSubject)
|
||||
irBlock.statements.add(irWhen)
|
||||
return irBlock
|
||||
irBlock
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user