From 2a4d27d8e6c99b8fe2b916dfed3e9ef5f0175424 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Mon, 30 Sep 2024 22:47:00 +0200 Subject: [PATCH] tweak --- hblang/src/codegen.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hblang/src/codegen.rs b/hblang/src/codegen.rs index 4e0365dd..a5583fba 100644 --- a/hblang/src/codegen.rs +++ b/hblang/src/codegen.rs @@ -2472,10 +2472,14 @@ impl Codegen { ty::Kind::Func(id) } Expr::BinOp { - left: &Expr::Ident { .. }, + left: &Expr::Ident { id, .. }, op: TokenKind::Decl, right: stru @ Expr::Struct { .. }, - } => self.ty(stru).expand(), + } => { + let str = self.ty(stru).expand().inner(); + self.tys.structs[str as usize].name = id; + ty::Kind::Struct(str) + } Expr::BinOp { left, op: TokenKind::Decl, right } => { let gid = self.tys.globals.len() as ty::Global; self.tys.globals.push(Global { file, name: ident, ..Default::default() });