diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-14 16:35:20 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-14 16:35:20 +0200 |
| commit | 49e6a0518eb6b7b09938b562ef270028337508bf (patch) | |
| tree | 788a14c49ab5ebf3dc19c9455a5128593d5d7ad4 /boot/materialization.cc | |
| parent | 8cc075c6a736fdde56ca2da03a868821695765f4 (diff) | |
| download | elna-49e6a0518eb6b7b09938b562ef270028337508bf.tar.gz | |
Reject local extern variables
Diffstat (limited to 'boot/materialization.cc')
| -rw-r--r-- | boot/materialization.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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<materialization_error>(declaration->position(), + materialization_error::kind::local_extern); + } } void materialization_visitor::visit(record_type_expression *expression) |
