Skip to content

Commit

Permalink
checker: Do not default to unit type when node is not present in typectx
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Aug 29, 2024
1 parent 59e8dae commit 4b2534a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions typecheck/src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ impl<'ctx> Checker<'ctx> {
fn get_type(&self, of: &RefIdx) -> &Type {
// if at this point, the reference is unresolved, or if we haven't seen that node yet, it's
// an interpreter error
self.0
.types
.type_of(of.expect_resolved())
.unwrap_or(self.unit())
self.0.types.type_of(of.expect_resolved()).unwrap()
}

fn unit(&self) -> &Type {
Expand Down Expand Up @@ -153,9 +150,6 @@ fn type_mismatch(
) -> Error {
let fmt = Fmt(fir);

dbg!(&expected.0);
dbg!(&got.0);

Error::new(ErrKind::TypeChecker)
.with_msg(format!(
"type mismatch found: expected {}, got {}",
Expand Down

0 comments on commit 4b2534a

Please sign in to comment.