From 49e6a0518eb6b7b09938b562ef270028337508bf Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 14 Sep 2026 16:35:20 +0200 Subject: Reject local extern variables --- boot/materialization.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'boot') diff --git a/boot/materialization.cc b/boot/materialization.cc index 5b200d5..0ca81aa 100644 --- a/boot/materialization.cc +++ b/boot/materialization.cc @@ -35,6 +35,8 @@ namespace elna::boot return "Real literal overflows"; case local_export: return "Local symbols cannot be exported"; + case local_extern: + return "Local symbols cannot be extern"; case field_export: return "Record fields cannot be exported"; } @@ -64,6 +66,11 @@ namespace elna::boot materialization_error::kind::local_export); } } + if (!this->in_global_scope && declaration->is_extern) + { + add_error(declaration->position(), + materialization_error::kind::local_extern); + } } void materialization_visitor::visit(record_type_expression *expression) -- cgit v1.2.3