structs r a lot more sane in code, can now actually assign & stuff

This commit is contained in:
2025-04-08 20:00:16 -04:00
parent cb9a366f43
commit 26e7a4da4a
21 changed files with 405 additions and 197 deletions

View File

@@ -1,10 +1,9 @@
use super::{IRUProgram, Len, TypeID};
use super::{IRUProgram, Len, StructID};
#[derive(Clone, PartialEq)]
pub enum Type {
Concrete(TypeID),
Bits(u32),
Generic { base: TypeID, args: Vec<Type> },
Struct { id: StructID, args: Vec<Type> },
Fn { args: Vec<Type>, ret: Box<Type> },
Ref(Box<Type>),
Slice(Box<Type>),
@@ -26,6 +25,7 @@ impl Type {
}
}
// should impl instead
pub fn resolve_types(ns: &IRUProgram) {
for (i, f) in ns.iter_fns() {
for inst in &f.instructions {