From 8d59de716fb5abf508b9c04cbc7b588b86577524 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Tue, 19 May 2020 16:47:30 +0300 Subject: [PATCH] Better fn name --- src/analysis.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 033475a..c9f6e8b 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -257,7 +257,7 @@ fn findReturnStatement(base_node: *ast.Node) ?*ast.Node.ControlFlowExpression { } /// Resolves the return type of a function -fn getContainerReturnType(analysis_ctx: *AnalysisContext, fn_decl: *ast.Node.FnProto) ?*ast.Node { +fn resolveReturnType(analysis_ctx: *AnalysisContext, fn_decl: *ast.Node.FnProto) ?*ast.Node { if (isTypeFunction(analysis_ctx.tree, fn_decl) and fn_decl.body_node != null) { // If this is a type function and it only contains a single return statement that returns // a container declaration, we will return that declaration. @@ -308,7 +308,7 @@ pub fn resolveTypeOfNode(analysis_ctx: *AnalysisContext, node: *ast.Node) ?*ast. .Call, .StructInitializer => { const decl = resolveTypeOfNode(analysis_ctx, suffix_op.lhs.node) orelse return null; return switch (decl.id) { - .FnProto => getContainerReturnType(analysis_ctx, decl.cast(ast.Node.FnProto).?), + .FnProto => resolveReturnType(analysis_ctx, decl.cast(ast.Node.FnProto).?), else => decl, }; },