[FE] Add context receivers getter to KtCallableDeclaration interface

This commit is contained in:
Anastasiya Shadrina
2021-01-26 17:41:31 +07:00
committed by TeamCityServer
parent d1fdc4d787
commit 7de8380ddf
9 changed files with 94 additions and 0 deletions
@@ -960,6 +960,11 @@ public class DescriptorResolver {
if (receiverTypeRef != null) {
receiverType = typeResolver.resolveType(scopeForDeclarationResolutionWithTypeParameters, receiverTypeRef, trace, true);
}
List<KtTypeReference> contextReceiverTypeRefs = variableDeclaration.getContextReceiverTypeReferences();
for (KtTypeReference contextReceiverTypeRef: contextReceiverTypeRefs) {
typeResolver.resolveType(scopeForDeclarationResolutionWithTypeParameters, contextReceiverTypeRef, trace, true);
}
}
ReceiverParameterDescriptor receiverDescriptor;
@@ -197,6 +197,9 @@ class FunctionDescriptorResolver(
if (function is KtFunctionLiteral) expectedFunctionType.getReceiverType() else null
}
function.contextReceiverTypeReferences.onEach {
typeResolver.resolveType(headerScope, it, trace, true)
}
val valueParameterDescriptors =
createValueParameterDescriptors(function, functionDescriptor, headerScope, trace, expectedFunctionType, inferenceSession)