[FIR] Analyze all statements in block except last one in independent mode
Some broken tests will be fixed in next commit #KT-37176 Fixed
This commit is contained in:
@@ -23,4 +23,8 @@ abstract class FirBlock : FirExpression() {
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitBlock(this, data)
|
||||
|
||||
abstract override fun replaceTypeRef(newTypeRef: FirTypeRef)
|
||||
|
||||
abstract fun <D> transformStatements(transformer: FirTransformer<D>, data: D): FirBlock
|
||||
|
||||
abstract fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirBlock
|
||||
}
|
||||
|
||||
@@ -32,8 +32,18 @@ internal class FirBlockImpl(
|
||||
}
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirBlockImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
transformStatements(transformer, data)
|
||||
transformOtherChildren(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatements(transformer: FirTransformer<D>, data: D): FirBlockImpl {
|
||||
statements.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirBlockImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeRef = typeRef.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
+9
@@ -30,6 +30,15 @@ class FirEmptyExpressionBlock : FirBlock() {
|
||||
}
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirEmptyExpressionBlock {
|
||||
transformOtherChildren(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatements(transformer: FirTransformer<D>, data: D): FirEmptyExpressionBlock {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirEmptyExpressionBlock {
|
||||
typeRef = typeRef.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user