Resolve local function parameters with function inner scope
This allows to use type parameters and value paramters in default value expressions #KT-7984 Fixed #KT-7985 Fixed
This commit is contained in:
+2
-2
@@ -101,18 +101,18 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
|
||||
// Necessary for local functions
|
||||
ForceResolveUtil.forceResolveAllContents(functionDescriptor.annotations)
|
||||
|
||||
val functionInnerScope = FunctionDescriptorUtil.getFunctionInnerScope(context.scope, functionDescriptor, context.trace, components.overloadChecker)
|
||||
if (!function.hasDeclaredReturnType() && !function.hasBlockBody()) {
|
||||
ForceResolveUtil.forceResolveAllContents(functionDescriptor.returnType)
|
||||
}
|
||||
else {
|
||||
val functionInnerScope = FunctionDescriptorUtil.getFunctionInnerScope(context.scope, functionDescriptor, context.trace, components.overloadChecker)
|
||||
components.expressionTypingServices.checkFunctionReturnType(
|
||||
functionInnerScope, function, functionDescriptor, context.dataFlowInfo, null, context.trace
|
||||
)
|
||||
}
|
||||
|
||||
components.valueParameterResolver.resolveValueParameters(
|
||||
function.valueParameters, functionDescriptor.valueParameters, context.scope, context.dataFlowInfo, context.trace
|
||||
function.valueParameters, functionDescriptor.valueParameters, functionInnerScope, context.dataFlowInfo, context.trace
|
||||
)
|
||||
|
||||
components.modifiersChecker.withTrace(context.trace).checkModifiersForLocalDeclaration(function, functionDescriptor)
|
||||
|
||||
Reference in New Issue
Block a user