1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

Merge pull request #910 from Zokrates/visit-declaration-key

Visit declaration key in folder
This commit is contained in:
Thibaut Schaeffer 2021-06-07 18:45:56 +02:00 committed by GitHub
commit 81fc555069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1 @@
Fix access to constant in local function call

View 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

View file

@ -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)))

View file

@ -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())