Merge pull request #910 from Zokrates/visit-declaration-key
Visit declaration key in folder
This commit is contained in:
commit
81fc555069
4 changed files with 10 additions and 2 deletions
1
changelogs/unreleased/910-schaeff
Normal file
1
changelogs/unreleased/910-schaeff
Normal file
|
@ -0,0 +1 @@
|
|||
Fix access to constant in local function call
|
7
zokrates_cli/examples/constant_in_sig.zok
Normal file
7
zokrates_cli/examples/constant_in_sig.zok
Normal file
|
@ -0,0 +1,7 @@
|
|||
const u32 N = 1
|
||||
def foo(bool[N] arr) -> bool:
|
||||
return true
|
||||
|
||||
def main(bool[N] arr):
|
||||
assert(foo(arr))
|
||||
return
|
|
@ -830,7 +830,7 @@ pub fn fold_function_call_expression<
|
|||
e: FunctionCallExpression<'ast, T, E>,
|
||||
) -> FunctionCallOrExpression<'ast, T, E> {
|
||||
FunctionCallOrExpression::FunctionCall(FunctionCallExpression::new(
|
||||
e.function_key,
|
||||
f.fold_declaration_function_key(e.function_key),
|
||||
e.generics
|
||||
.into_iter()
|
||||
.map(|g| g.map(|g| f.fold_uint_expression(g)))
|
||||
|
|
|
@ -632,7 +632,7 @@ pub fn fold_function_call_expression<
|
|||
e: FunctionCallExpression<'ast, T, E>,
|
||||
) -> Result<FunctionCallOrExpression<'ast, T, E>, F::Error> {
|
||||
Ok(FunctionCallOrExpression::Expression(E::function_call(
|
||||
e.function_key,
|
||||
f.fold_declaration_function_key(e.function_key)?,
|
||||
e.generics
|
||||
.into_iter()
|
||||
.map(|g| g.map(|g| f.fold_uint_expression(g)).transpose())
|
||||
|
|
Loading…
Reference in a new issue