Fix parsing struct types

This commit is contained in:
Sofia 2026-04-15 19:09:38 +03:00
parent 8e7facc593
commit 1265040f29

View File

@ -549,6 +549,13 @@ namespace parsing {
auto ty = parse_type(inner, scope).unwrap();
inner.expect(token::Type::Symbol, ";");
if (ty->m_kind == types::TypeKind::Struct) {
auto struct_ty = dynamic_cast<types::StructType*>(ty.get());
if (!struct_ty->m_is_ref && struct_ty->m_name) {
scope.structs[*struct_ty->m_name] = ty;
}
}
stream.m_position = inner.m_position;
auto tl_typedef = new AST::TopLevelTypedef{
before_meta + stream.metadata(), ty