aboutsummaryrefslogtreecommitdiff
path: root/boot/symbol.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-29 01:16:18 +0200
committerEugen Wissner <belka@caraus.de>2026-07-29 01:16:18 +0200
commitf8daedce5c73e02dfb2fc59d75777190185584df (patch)
tree9ec211b96c3d7efd2fca0da37baeaa8b341e31fb /boot/symbol.cc
parent36a274c9a8bca944234589220def025d3920b3ef (diff)
downloadelna-f8daedce5c73e02dfb2fc59d75777190185584df.tar.gz
Validate cast compatibility during semantic analysis
Diffstat (limited to 'boot/symbol.cc')
-rw-r--r--boot/symbol.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/boot/symbol.cc b/boot/symbol.cc
index e0a89e6..a51ee01 100644
--- a/boot/symbol.cc
+++ b/boot/symbol.cc
@@ -448,6 +448,14 @@ namespace elna::boot
|| is_primitive_type(checked, "Pointer");
}
+ bool is_scalar_type(const type& checked)
+ {
+ return is_discrete_type(checked)
+ || is_primitive_type(checked, "Float")
+ || is_any_pointer_type(checked)
+ || checked.get<enumeration_type>() != nullptr;
+ }
+
type get_range_base_type(const type& range)
{
if (auto array = range.get<array_type>())