diff options
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |