diff --git a/reid-llvm-lib/src/builder.rs b/reid-llvm-lib/src/builder.rs index eaf875e..24b4efd 100644 --- a/reid-llvm-lib/src/builder.rs +++ b/reid-llvm-lib/src/builder.rs @@ -385,10 +385,12 @@ impl Builder { } Instr::FunctionCall(fun, params) => { let param_types = self.function_data(&fun).params; + dbg!(¶ms, ¶m_types); if param_types.len() != params.len() { return Err(()); // TODO error: invalid amount of params } for (a, b) in param_types.iter().zip(params) { + dbg!(b.get_type(&self)?); if *a != b.get_type(&self)? { return Err(()); // TODO error: params do not match } diff --git a/reid/src/mir/typecheck.rs b/reid/src/mir/typecheck.rs index d082280..8b361ef 100644 --- a/reid/src/mir/typecheck.rs +++ b/reid/src/mir/typecheck.rs @@ -408,7 +408,7 @@ impl Expression { ExprKind::BinOp(op, lhs, rhs) => { // TODO make sure lhs and rhs can actually do this binary // operation once relevant - let lhs_res = lhs.typecheck(state, &typerefs, None); + let lhs_res = lhs.typecheck(state, &typerefs, hint_t); let lhs_type = state.or_else(lhs_res, TypeKind::Vague(Vague::Unknown), lhs.1); let rhs_res = rhs.typecheck(state, &typerefs, Some(&lhs_type)); let rhs_type = state.or_else(rhs_res, TypeKind::Vague(Vague::Unknown), rhs.1); diff --git a/reid_src/test.reid b/reid_src/test.reid index 0cb24aa..9d7a3b1 100644 --- a/reid_src/test.reid +++ b/reid_src/test.reid @@ -1,3 +1,5 @@ +struct SDL_Thing {} + extern fn SDL_malloc(size: u64) -> *SDL_Thing; fn main() {