From 993458f4be7c281afc6c54dae52a2ada2f5702ba Mon Sep 17 00:00:00 2001 From: shadow cat Date: Fri, 11 Apr 2025 02:37:47 -0400 Subject: [PATCH] small stuff --- src/main.rs | 1 - src/parser/v3/lower/expr.rs | 2 +- src/parser/v3/lower/func.rs | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0c5953e..44e8d71 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use ir::{LProgram, UProgram}; use parser::{NodeParsable, PModule, PStatement, ParserCtx}; -use util::Labelable; use std::{ fs::{create_dir_all, OpenOptions}, io::{stdout, BufRead, BufReader}, diff --git a/src/parser/v3/lower/expr.rs b/src/parser/v3/lower/expr.rs index 76f82d5..29e6544 100644 --- a/src/parser/v3/lower/expr.rs +++ b/src/parser/v3/lower/expr.rs @@ -122,7 +122,7 @@ impl FnLowerable for PExpr { } UnaryOp::Deref => { let t = &ctx.program.expect(res.id).ty; - let Type::Ref(inner) = t else { + let Type::Ref(_) = t else { ctx.err(format!( "Cannot dereference type {:?}", ctx.program.type_name(t) diff --git a/src/parser/v3/lower/func.rs b/src/parser/v3/lower/func.rs index 416f3d4..117547e 100644 --- a/src/parser/v3/lower/func.rs +++ b/src/parser/v3/lower/func.rs @@ -6,7 +6,7 @@ use crate::{ impl Node { pub fn lower_name(&self, p: &mut UProgram) -> Option { - Some(self.as_ref()?.lower_name(p)?) + self.as_ref()?.lower_name(p) } pub fn lower(&self, id: FnID, p: &mut UProgram, output: &mut CompilerOutput) { if let Some(s) = self.as_ref() { @@ -24,6 +24,7 @@ impl PFunction { name.to_string(), Some(UVar { parent: None, + // this gets replaced with the correct type later ty: Type::Error, origin: self.header.span, }),