Minor: constructor IrExpressionBodyImpl(IrExpression)

This commit is contained in:
Dmitry Petrov
2017-02-27 18:54:34 +03:00
parent e66c2621af
commit 045a12ddc6
5 changed files with 7 additions and 9 deletions
@@ -27,6 +27,8 @@ class IrExpressionBodyImpl(startOffset: Int, endOffset: Int) : IrElementBase(sta
this.expression = expression
}
constructor(expression: IrExpression) : this(expression.startOffset, expression.endOffset, expression)
override lateinit var expression: IrExpression
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
@@ -178,10 +178,7 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
throw IllegalArgumentException("Unsupported body type: $body")
override fun visitExpressionBody(body: IrExpressionBody): IrExpressionBody =
IrExpressionBodyImpl(
body.startOffset, body.endOffset,
body.expression.transform(this, null)
)
IrExpressionBodyImpl(body.expression.transform(this, null))
override fun visitBlockBody(body: IrBlockBody): IrBlockBody =
IrBlockBodyImpl(