small stuff

This commit is contained in:
2025-04-11 02:37:47 -04:00
parent 44824b8b5a
commit 993458f4be
3 changed files with 3 additions and 3 deletions

View File

@@ -7,7 +7,6 @@
use ir::{LProgram, UProgram}; use ir::{LProgram, UProgram};
use parser::{NodeParsable, PModule, PStatement, ParserCtx}; use parser::{NodeParsable, PModule, PStatement, ParserCtx};
use util::Labelable;
use std::{ use std::{
fs::{create_dir_all, OpenOptions}, fs::{create_dir_all, OpenOptions},
io::{stdout, BufRead, BufReader}, io::{stdout, BufRead, BufReader},

View File

@@ -122,7 +122,7 @@ impl FnLowerable for PExpr {
} }
UnaryOp::Deref => { UnaryOp::Deref => {
let t = &ctx.program.expect(res.id).ty; let t = &ctx.program.expect(res.id).ty;
let Type::Ref(inner) = t else { let Type::Ref(_) = t else {
ctx.err(format!( ctx.err(format!(
"Cannot dereference type {:?}", "Cannot dereference type {:?}",
ctx.program.type_name(t) ctx.program.type_name(t)

View File

@@ -6,7 +6,7 @@ use crate::{
impl Node<PFunction> { impl Node<PFunction> {
pub fn lower_name(&self, p: &mut UProgram) -> Option<FnID> { pub fn lower_name(&self, p: &mut UProgram) -> Option<FnID> {
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) { pub fn lower(&self, id: FnID, p: &mut UProgram, output: &mut CompilerOutput) {
if let Some(s) = self.as_ref() { if let Some(s) = self.as_ref() {
@@ -24,6 +24,7 @@ impl PFunction {
name.to_string(), name.to_string(),
Some(UVar { Some(UVar {
parent: None, parent: None,
// this gets replaced with the correct type later
ty: Type::Error, ty: Type::Error,
origin: self.header.span, origin: self.header.span,
}), }),