diff --git a/crates/aiken-lang/src/tipo/expr.rs b/crates/aiken-lang/src/tipo/expr.rs index a851cb69..4f42c8ca 100644 --- a/crates/aiken-lang/src/tipo/expr.rs +++ b/crates/aiken-lang/src/tipo/expr.rs @@ -1505,7 +1505,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> { self.unify(bool(), condition.tipo(), condition.type_defining_location())?; - let body = self.infer(first.body.clone())?; + let body = self.infer(branch.body.clone())?; self.unify(tipo.clone(), body.tipo(), body.type_defining_location())?; diff --git a/examples/acceptance_tests/031/lib/tests.ak b/examples/acceptance_tests/031/lib/tests.ak index 8add4a60..566a09c8 100644 --- a/examples/acceptance_tests/031/lib/tests.ak +++ b/examples/acceptance_tests/031/lib/tests.ak @@ -1,4 +1,4 @@ -pub fn clamp(n: Int, min min: Int, max max: Int) -> Int { +pub fn clamp(n: Int, min: Int, max: Int) -> Int { if n < min { min } else if n > max {