From 3f038428a7f282468011415db76da4bf08ddb67c Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 14 Nov 2021 15:12:37 +0000 Subject: Begin minimizing `Ast` size --- src/check_type.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 398967af8..b7feb562d 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1939,8 +1939,9 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node, error(proc_type_node, "A procedure type with the #optional_second tag requires 2 return values, got %td", result_count); } else { bool ok = false; - if (proc_type_node->file && proc_type_node->file->pkg) { - ok = proc_type_node->file->pkg->scope == ctx->info->runtime_package->scope; + AstFile *file = proc_type_node->file(); + if (file && file->pkg) { + ok = file->pkg->scope == ctx->info->runtime_package->scope; } if (!ok) { -- cgit v1.2.3