Commit 93d83bf 1 parent f729a00 commit 93d83bf Copy full SHA for 93d83bf
File tree 3 files changed +18
-1
lines changed
nargo/tests/test_data/main_bool_arg
noirc_abi/src/input_parser
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
x = true
2
+ y = [true , false ]
Original file line number Diff line number Diff line change 1
- fn main (x : bool ) {
1
+ fn main (x : bool , y : [ bool ; 2 ] ) {
2
2
if x {
3
3
constrain 1 != 2 ;
4
4
}
5
+
5
6
constrain x ;
7
+ constrain y [0 ] != y [1 ];
6
8
}
Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ enum TomlTypes {
60
60
ArrayNum ( Vec < u64 > ) ,
61
61
// Array of hexadecimal integers
62
62
ArrayString ( Vec < String > ) ,
63
+ // Array of booleans
64
+ ArrayBool ( Vec < bool > ) ,
63
65
// Struct of TomlTypes
64
66
Table ( BTreeMap < String , TomlTypes > ) ,
65
67
}
@@ -122,6 +124,18 @@ impl InputValue {
122
124
123
125
InputValue :: Vec ( array_elements)
124
126
}
127
+ TomlTypes :: ArrayBool ( arr_bool) => {
128
+ let array_elements = vecmap ( arr_bool, |elem_bool| {
129
+ if elem_bool {
130
+ FieldElement :: one ( )
131
+ } else {
132
+ FieldElement :: zero ( )
133
+ }
134
+ } ) ;
135
+
136
+ InputValue :: Vec ( array_elements)
137
+ }
138
+
125
139
TomlTypes :: Table ( table) => {
126
140
let fields = match param_type {
127
141
AbiType :: Struct { fields } => fields,
You can’t perform that action at this time.
0 commit comments