From 73df4653556a7d1c74d184e27ec5a8ca3be47af9 Mon Sep 17 00:00:00 2001 From: jfecher Date: Tue, 18 Apr 2023 15:42:20 -0500 Subject: [PATCH] fix: allow comptime or non comptime fields in unconstrained for loops (#1172) Fix unconstrained for loops to allow comptime or non comptime fields --- crates/noirc_frontend/src/hir/type_check/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/noirc_frontend/src/hir/type_check/expr.rs b/crates/noirc_frontend/src/hir/type_check/expr.rs index e57dcdb0ffc..aba44e36d2c 100644 --- a/crates/noirc_frontend/src/hir/type_check/expr.rs +++ b/crates/noirc_frontend/src/hir/type_check/expr.rs @@ -155,7 +155,7 @@ impl<'interner> TypeChecker<'interner> { let mut unify_loop_range = |actual_type, span| { let expected_type = if self.is_unconstrained() { - Type::field(Some(span)) + Type::FieldElement(CompTime::new(self.interner)) } else { Type::comp_time(Some(span)) };