FIR: Resolve anonymous function bodies during
IMPLICIT_TYPES_BODY_RESOLVE phase. This fixes an issue where some FirAnnotationCalls can be left with some implicit type refs if they have anonymous functions in the arguments.
This commit is contained in:
committed by
TeamCityServer
parent
e69b729e21
commit
edb6b337dc
+6
-2
@@ -634,7 +634,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
}
|
}
|
||||||
is ResolutionMode.LambdaResolution -> {
|
is ResolutionMode.LambdaResolution -> {
|
||||||
context.withAnonymousFunction(anonymousFunction, components, data) {
|
context.withAnonymousFunction(anonymousFunction, components, data) {
|
||||||
transformAnonymousFunctionWithLambdaResolution(anonymousFunction, data).addReturn()
|
withFullBodyResolve {
|
||||||
|
transformAnonymousFunctionWithLambdaResolution(anonymousFunction, data).addReturn()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ResolutionMode.WithExpectedType, is ResolutionMode.ContextIndependent -> {
|
is ResolutionMode.WithExpectedType, is ResolutionMode.ContextIndependent -> {
|
||||||
@@ -696,7 +698,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
lambda = lambda.transformValueParameters(ImplicitToErrorTypeTransformer, null)
|
lambda = lambda.transformValueParameters(ImplicitToErrorTypeTransformer, null)
|
||||||
val bodyExpectedType = returnTypeRefFromResolvedAtom ?: expectedTypeRef
|
val bodyExpectedType = returnTypeRefFromResolvedAtom ?: expectedTypeRef
|
||||||
context.withAnonymousFunction(lambda, components, data) {
|
context.withAnonymousFunction(lambda, components, data) {
|
||||||
lambda = transformFunction(lambda, withExpectedType(bodyExpectedType)) as FirAnonymousFunction
|
withFullBodyResolve {
|
||||||
|
lambda = transformFunction(lambda, withExpectedType(bodyExpectedType)) as FirAnonymousFunction
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// To separate function and separate commit
|
// To separate function and separate commit
|
||||||
val writer = FirCallCompletionResultsWriterTransformer(
|
val writer = FirCallCompletionResultsWriterTransformer(
|
||||||
|
|||||||
Reference in New Issue
Block a user