[FIR] Add inline checker for bodies of inline functions
This checker doesn't support `@PublishedAPI` yet, so some BB tests for it were muted. #KT-46270
This commit is contained in:
committed by
TeamCityServer
parent
7e052c1eb1
commit
32c3f85679
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.expressions.impl.FirBlockImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirPartiallyResolvedArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirSingleExpressionBlock
|
||||
import org.jetbrains.kotlin.fir.references.FirReference
|
||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
@@ -65,6 +66,10 @@ fun FirExpression.toResolvedCallableSymbol(): FirCallableSymbol<*>? {
|
||||
return toResolvedCallableReference()?.resolvedSymbol as FirCallableSymbol<*>?
|
||||
}
|
||||
|
||||
fun FirReference.toResolvedCallableSymbol(): FirCallableSymbol<*>? {
|
||||
return (this as? FirResolvedNamedReference)?.resolvedSymbol as? FirCallableSymbol<*>
|
||||
}
|
||||
|
||||
fun buildErrorLoop(source: FirSourceElement?, diagnostic: ConeDiagnostic): FirErrorLoop {
|
||||
return buildErrorLoop {
|
||||
this.source = source
|
||||
@@ -109,4 +114,4 @@ fun FirBlock.replaceFirstStatement(statement: FirStatement): FirStatement {
|
||||
return existed
|
||||
}
|
||||
|
||||
fun FirExpression.unwrapArgument(): FirExpression = (this as? FirWrappedArgumentExpression)?.expression ?: this
|
||||
fun FirExpression.unwrapArgument(): FirExpression = (this as? FirWrappedArgumentExpression)?.expression ?: this
|
||||
|
||||
Reference in New Issue
Block a user