small stuff
This commit is contained in:
@@ -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},
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user