This commit is contained in:
Pranav Gaddamadugu 2022-08-18 11:20:36 -07:00
parent b43d8b318f
commit 0936771fb4
2 changed files with 8 additions and 4 deletions

View File

@ -158,10 +158,10 @@ impl ExpressionConsumer for StaticSingleAssigner<'_> {
// Note that we do not construct a new assignment statement for the tuple expression. // Note that we do not construct a new assignment statement for the tuple expression.
// Expressions that produce compound data types need to be handled separately. // Expressions that produce compound data types need to be handled separately.
( (
Expression::Circuit(CircuitExpression{ Expression::Circuit(CircuitExpression {
name: input.name, name: input.name,
span: input.span, span: input.span,
members members,
}), }),
statements, statements,
) )

View File

@ -17,7 +17,10 @@
use crate::StaticSingleAssigner; use crate::StaticSingleAssigner;
use itertools::Itertools; use itertools::Itertools;
use leo_ast::{Block, CircuitExpression, CircuitVariableInitializer, Expression, Function, FunctionConsumer, Identifier, Program, ProgramConsumer, ReturnStatement, Statement, StatementConsumer, TernaryExpression, TupleExpression}; use leo_ast::{
Block, CircuitExpression, CircuitVariableInitializer, Expression, Function, FunctionConsumer, Identifier, Program,
ProgramConsumer, ReturnStatement, Statement, StatementConsumer, TernaryExpression, TupleExpression,
};
impl FunctionConsumer for StaticSingleAssigner<'_> { impl FunctionConsumer for StaticSingleAssigner<'_> {
type Output = Function; type Output = Function;
@ -105,7 +108,8 @@ impl FunctionConsumer for StaticSingleAssigner<'_> {
match if_false.expression { match if_false.expression {
None => Expression::Identifier(if_false.identifier), None => Expression::Identifier(if_false.identifier),
Some(expr) => expr, Some(expr) => expr,
}); },
);
CircuitVariableInitializer { CircuitVariableInitializer {
identifier: if_true.identifier, identifier: if_true.identifier,
expression: Some(expression), expression: Some(expression),