mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-24 10:52:29 +03:00
alias resolution done during type inference
This commit is contained in:
parent
1576f776f3
commit
1628e19658
@ -18,7 +18,7 @@ use std::{cell::Cell, unimplemented};
|
||||
|
||||
use typed_arena::Arena;
|
||||
|
||||
use crate::{ArenaNode, Circuit, Expression, Function, Scope, Statement, Variable};
|
||||
use crate::{Alias, ArenaNode, Circuit, Expression, Function, Scope, Statement, Variable};
|
||||
|
||||
pub struct AsgContextInner<'a> {
|
||||
pub arena: &'a Arena<ArenaNode<'a>>,
|
||||
@ -74,6 +74,14 @@ impl<'a> AsgContextInner<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::mut_from_ref)]
|
||||
pub fn alloc_alias(&'a self, expr: Alias<'a>) -> &'a Alias<'a> {
|
||||
match self.arena.alloc(ArenaNode::Alias(expr)) {
|
||||
ArenaNode::Alias(e) => e,
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::mut_from_ref)]
|
||||
pub fn alloc_circuit(&'a self, circuit: Circuit<'a>) -> &'a Circuit<'a> {
|
||||
match self.arena.alloc(ArenaNode::Circuit(circuit)) {
|
||||
|
@ -98,31 +98,8 @@ impl<'a> Asg<'a> {
|
||||
pub fn into_repr(self) -> Program<'a> {
|
||||
self.asg
|
||||
}
|
||||
|
||||
// /// Serializes the ast into a JSON string.
|
||||
// pub fn to_json_string(&self) -> Result<String, serde_json::Error> {
|
||||
// serde_json::to_string_pretty(&self.asg)
|
||||
// }
|
||||
//
|
||||
// /// Deserializes the JSON string into a ast.
|
||||
// pub fn from_json_string(json: &str) -> Result<Self, serde_json::Error> {
|
||||
// let ast: Program = serde_json::from_str(json)?;
|
||||
// Ok(Self { ast })
|
||||
// }
|
||||
}
|
||||
|
||||
// TODO (howardwu): Remove this.
|
||||
/* pub fn load_asg<'a, T: ImportResolver<'a>>(
|
||||
context: AsgContext<'a>,
|
||||
content: &str,
|
||||
resolver: &mut T,
|
||||
) -> Result<Program<'a>> {
|
||||
// Parses the Leo file and constructs a grammar ast.
|
||||
let ast = leo_parser::parse_ast("input.leo", content)?;
|
||||
|
||||
Program::new(context, ast.as_repr())
|
||||
} */
|
||||
|
||||
pub fn new_alloc_context<'a>() -> Arena<ArenaNode<'a>> {
|
||||
Arena::new()
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{AsgContextInner, Circuit, Expression, Function, PartialType, Scope, Statement, Variable};
|
||||
use crate::{Alias, AsgContextInner, Circuit, Expression, Function, PartialType, Scope, Statement, Variable};
|
||||
|
||||
use leo_errors::{Result, Span};
|
||||
|
||||
@ -37,4 +37,5 @@ pub enum ArenaNode<'a> {
|
||||
Circuit(Circuit<'a>),
|
||||
Function(Function<'a>),
|
||||
Inner(AsgContextInner<'a>),
|
||||
Alias(Alias<'a>),
|
||||
}
|
||||
|
58
asg/src/program/alias.rs
Normal file
58
asg/src/program/alias.rs
Normal file
@ -0,0 +1,58 @@
|
||||
// Copyright (C) 2019-2021 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{Identifier, Node, Scope, Type};
|
||||
use leo_errors::{Result, Span};
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Alias<'a> {
|
||||
pub id: u32,
|
||||
pub name: RefCell<Identifier>,
|
||||
pub span: Option<Span>,
|
||||
pub represents: Type<'a>,
|
||||
}
|
||||
|
||||
impl<'a> PartialEq for Alias<'a> {
|
||||
fn eq(&self, other: &Alias) -> bool {
|
||||
if self.name != other.name {
|
||||
return false;
|
||||
}
|
||||
self.id == other.id
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Eq for Alias<'a> {}
|
||||
|
||||
impl<'a> Node for Alias<'a> {
|
||||
fn span(&self) -> Option<&Span> {
|
||||
self.span.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Alias<'a> {
|
||||
pub(super) fn init(scope: &'a Scope<'a>, value: &leo_ast::Alias) -> Result<&'a Alias<'a>> {
|
||||
let alias = scope.context.alloc_alias(Alias {
|
||||
id: scope.context.get_id(),
|
||||
name: RefCell::new(value.name.clone()),
|
||||
span: Some(value.span.clone()),
|
||||
represents: scope.resolve_ast_type(&value.represents, &value.span)?,
|
||||
});
|
||||
|
||||
Ok(alias)
|
||||
}
|
||||
}
|
@ -18,6 +18,9 @@
|
||||
//!
|
||||
//!
|
||||
|
||||
mod alias;
|
||||
pub use alias::*;
|
||||
|
||||
mod circuit;
|
||||
pub use circuit::*;
|
||||
|
||||
@ -25,8 +28,8 @@ mod function;
|
||||
pub use function::*;
|
||||
|
||||
use crate::{node::FromAst, ArenaNode, AsgContext, DefinitionStatement, Input, Scope, Statement};
|
||||
// use leo_ast::{PackageAccess, PackageOrPackages};
|
||||
use leo_errors::{AsgError, Result};
|
||||
use leo_ast::{PackageAccess, PackageOrPackages};
|
||||
use leo_errors::{AsgError, AstError, Result, Span};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use std::cell::{Cell, RefCell};
|
||||
@ -46,6 +49,9 @@ pub struct Program<'a> {
|
||||
/// these should generally not be accessed directly, but through scoped imports
|
||||
pub imported_modules: IndexMap<String, Program<'a>>,
|
||||
|
||||
/// Maps alias name => alias definition.
|
||||
pub aliases: IndexMap<String, &'a Alias<'a>>,
|
||||
|
||||
/// Maps function name => function code block.
|
||||
pub functions: IndexMap<String, &'a Function<'a>>,
|
||||
|
||||
@ -58,6 +64,72 @@ pub struct Program<'a> {
|
||||
pub scope: &'a Scope<'a>,
|
||||
}
|
||||
|
||||
/// Enumerates what names are imported from a package.
|
||||
#[derive(Clone)]
|
||||
enum ImportSymbol {
|
||||
/// Import the symbol by name.
|
||||
Direct(String),
|
||||
|
||||
/// Import the symbol by name and store it under an alias.
|
||||
Alias(String, String), // from remote -> to local
|
||||
|
||||
/// Import all symbols from the package.
|
||||
All,
|
||||
}
|
||||
|
||||
fn resolve_import_package(
|
||||
output: &mut Vec<(Vec<String>, ImportSymbol, Span)>,
|
||||
mut package_segments: Vec<String>,
|
||||
package_or_packages: &PackageOrPackages,
|
||||
) {
|
||||
match package_or_packages {
|
||||
PackageOrPackages::Package(package) => {
|
||||
package_segments.push(package.name.name.to_string());
|
||||
resolve_import_package_access(output, package_segments, &package.access);
|
||||
}
|
||||
PackageOrPackages::Packages(packages) => {
|
||||
package_segments.push(packages.name.name.to_string());
|
||||
for access in packages.accesses.clone() {
|
||||
resolve_import_package_access(output, package_segments.clone(), &access);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_import_package_access(
|
||||
output: &mut Vec<(Vec<String>, ImportSymbol, Span)>,
|
||||
mut package_segments: Vec<String>,
|
||||
package: &PackageAccess,
|
||||
) {
|
||||
match package {
|
||||
PackageAccess::Star { span } => {
|
||||
output.push((package_segments, ImportSymbol::All, span.clone()));
|
||||
}
|
||||
PackageAccess::SubPackage(subpackage) => {
|
||||
resolve_import_package(
|
||||
output,
|
||||
package_segments,
|
||||
&PackageOrPackages::Package(*(*subpackage).clone()),
|
||||
);
|
||||
}
|
||||
PackageAccess::Symbol(symbol) => {
|
||||
let span = symbol.symbol.span.clone();
|
||||
let symbol = if let Some(alias) = symbol.alias.as_ref() {
|
||||
ImportSymbol::Alias(symbol.symbol.name.to_string(), alias.name.to_string())
|
||||
} else {
|
||||
ImportSymbol::Direct(symbol.symbol.name.to_string())
|
||||
};
|
||||
output.push((package_segments, symbol, span));
|
||||
}
|
||||
PackageAccess::Multiple(packages) => {
|
||||
package_segments.push(packages.name.name.to_string());
|
||||
for subaccess in packages.accesses.iter() {
|
||||
resolve_import_package_access(output, package_segments.clone(), subaccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Program<'a> {
|
||||
/// Returns a new Leo program ASG from the given Leo program AST and its imports.
|
||||
///
|
||||
@ -68,10 +140,68 @@ impl<'a> Program<'a> {
|
||||
/// 4. resolve all asg nodes
|
||||
///
|
||||
pub fn new(context: AsgContext<'a>, program: &leo_ast::Program) -> Result<Program<'a>> {
|
||||
let mut imported_modules: IndexMap<String, Program> = IndexMap::new();
|
||||
// Convert each sub AST.
|
||||
let mut imported_modules: IndexMap<Vec<String>, Program> = IndexMap::new();
|
||||
for (package, program) in program.imports.iter() {
|
||||
imported_modules.insert(package.clone(), Program::new(context, program)?);
|
||||
}
|
||||
|
||||
for (name, program) in program.imports.iter() {
|
||||
imported_modules.insert(name.clone(), Program::new(context, program)?);
|
||||
let mut imported_symbols: Vec<(Vec<String>, ImportSymbol, Span)> = vec![];
|
||||
for import_statement in program.import_statements.iter() {
|
||||
resolve_import_package(&mut imported_symbols, vec![], &import_statement.package_or_packages);
|
||||
}
|
||||
|
||||
let mut deduplicated_imports: IndexMap<Vec<String>, Span> = IndexMap::new();
|
||||
for (package, _symbol, span) in imported_symbols.iter() {
|
||||
deduplicated_imports.insert(package.clone(), span.clone());
|
||||
}
|
||||
|
||||
let mut imported_aliases: IndexMap<String, &'a Alias<'a>> = IndexMap::new();
|
||||
let mut imported_functions: IndexMap<String, &'a Function<'a>> = IndexMap::new();
|
||||
let mut imported_circuits: IndexMap<String, &'a Circuit<'a>> = IndexMap::new();
|
||||
let mut imported_global_consts: IndexMap<String, &'a DefinitionStatement<'a>> = IndexMap::new();
|
||||
|
||||
for (package, symbol, span) in imported_symbols.into_iter() {
|
||||
let pretty_package = package.join(".");
|
||||
|
||||
let resolved_package = imported_modules
|
||||
.get_mut(&package)
|
||||
.expect("could not find preloaded package");
|
||||
|
||||
match symbol {
|
||||
ImportSymbol::All => {
|
||||
imported_aliases.extend(resolved_package.aliases.clone().into_iter());
|
||||
imported_functions.extend(resolved_package.functions.clone().into_iter());
|
||||
imported_circuits.extend(resolved_package.circuits.clone().into_iter());
|
||||
imported_global_consts.extend(resolved_package.global_consts.clone().into_iter());
|
||||
}
|
||||
ImportSymbol::Direct(name) => {
|
||||
if let Some(alias) = resolved_package.aliases.get(&name) {
|
||||
imported_aliases.insert(name.clone(), *alias);
|
||||
} else if let Some(function) = resolved_package.functions.get(&name) {
|
||||
imported_functions.insert(name.clone(), *function);
|
||||
} else if let Some(circuit) = resolved_package.circuits.get(&name) {
|
||||
imported_circuits.insert(name.clone(), *circuit);
|
||||
} else if let Some(global_const) = resolved_package.global_consts.get(&name) {
|
||||
imported_global_consts.insert(name.clone(), *global_const);
|
||||
} else {
|
||||
return Err(AstError::unresolved_import(pretty_package, &span).into());
|
||||
}
|
||||
}
|
||||
ImportSymbol::Alias(name, alias) => {
|
||||
if let Some(type_alias) = resolved_package.aliases.get(&name) {
|
||||
imported_aliases.insert(alias.clone(), *type_alias);
|
||||
} else if let Some(function) = resolved_package.functions.get(&name) {
|
||||
imported_functions.insert(alias.clone(), *function);
|
||||
} else if let Some(circuit) = resolved_package.circuits.get(&name) {
|
||||
imported_circuits.insert(alias.clone(), *circuit);
|
||||
} else if let Some(global_const) = resolved_package.global_consts.get(&name) {
|
||||
imported_global_consts.insert(alias.clone(), *global_const);
|
||||
} else {
|
||||
return Err(AstError::unresolved_import(pretty_package, &span).into());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let import_scope = match context.arena.alloc(ArenaNode::Scope(Box::new(Scope {
|
||||
@ -79,9 +209,10 @@ impl<'a> Program<'a> {
|
||||
id: context.get_id(),
|
||||
parent_scope: Cell::new(None),
|
||||
variables: RefCell::new(IndexMap::new()),
|
||||
functions: RefCell::new(IndexMap::new()),
|
||||
global_consts: RefCell::new(IndexMap::new()),
|
||||
circuits: RefCell::new(IndexMap::new()),
|
||||
aliases: RefCell::new(imported_aliases),
|
||||
functions: RefCell::new(imported_functions),
|
||||
global_consts: RefCell::new(imported_global_consts),
|
||||
circuits: RefCell::new(imported_circuits),
|
||||
function: Cell::new(None),
|
||||
input: Cell::new(None),
|
||||
}))) {
|
||||
@ -95,6 +226,7 @@ impl<'a> Program<'a> {
|
||||
id: context.get_id(),
|
||||
parent_scope: Cell::new(Some(import_scope)),
|
||||
variables: RefCell::new(IndexMap::new()),
|
||||
aliases: RefCell::new(IndexMap::new()),
|
||||
functions: RefCell::new(IndexMap::new()),
|
||||
global_consts: RefCell::new(IndexMap::new()),
|
||||
circuits: RefCell::new(IndexMap::new()),
|
||||
@ -117,6 +249,13 @@ impl<'a> Program<'a> {
|
||||
scope.circuits.borrow_mut().insert(name.name.to_string(), asg_circuit);
|
||||
}
|
||||
|
||||
for (name, alias) in program.aliases.iter() {
|
||||
assert_eq!(name.name, alias.name.name);
|
||||
|
||||
let asg_alias = Alias::init(scope, alias)?;
|
||||
scope.aliases.borrow_mut().insert(name.name.to_string(), asg_alias);
|
||||
}
|
||||
|
||||
for (name, function) in program.functions.iter() {
|
||||
assert_eq!(name.name, function.identifier.name);
|
||||
let function = Function::init(scope, function)?;
|
||||
@ -136,6 +275,21 @@ impl<'a> Program<'a> {
|
||||
}
|
||||
|
||||
// Load concrete definitions.
|
||||
let mut aliases = IndexMap::new();
|
||||
for (name, alias) in program.aliases.iter() {
|
||||
assert_eq!(name.name, alias.name.name);
|
||||
let asg_alias = *scope.aliases.borrow().get(name.name.as_ref()).unwrap();
|
||||
|
||||
let name = name.name.to_string();
|
||||
|
||||
if aliases.contains_key(&name) {
|
||||
// TODO new error for duplicate aliases
|
||||
return Err(AsgError::duplicate_function_definition(name, &alias.span).into());
|
||||
}
|
||||
|
||||
aliases.insert(name, asg_alias);
|
||||
}
|
||||
|
||||
let mut global_consts = IndexMap::new();
|
||||
for (name, global_const) in program.global_consts.iter() {
|
||||
global_const
|
||||
@ -177,10 +331,14 @@ impl<'a> Program<'a> {
|
||||
context,
|
||||
id: context.get_id(),
|
||||
name: program.name.clone(),
|
||||
aliases,
|
||||
functions,
|
||||
global_consts,
|
||||
circuits,
|
||||
imported_modules,
|
||||
imported_modules: imported_modules
|
||||
.into_iter()
|
||||
.map(|(package, program)| (package.join("."), program))
|
||||
.collect(),
|
||||
scope,
|
||||
})
|
||||
}
|
||||
|
@ -334,6 +334,7 @@ impl<'a, R: ReconstructingReducerProgram<'a>> ReconstructingDirector<'a, R> {
|
||||
.iter()
|
||||
.map(|(module, import)| (module.clone(), self.reduce_program(import.clone())))
|
||||
.collect();
|
||||
let aliases = input.aliases.iter().map(|(name, a)| (name.clone(), *a)).collect();
|
||||
let functions = input
|
||||
.functions
|
||||
.iter()
|
||||
@ -352,6 +353,6 @@ impl<'a, R: ReconstructingReducerProgram<'a>> ReconstructingDirector<'a, R> {
|
||||
.collect();
|
||||
|
||||
self.reducer
|
||||
.reduce_program(input, imported_modules, functions, circuits, global_consts)
|
||||
.reduce_program(input, imported_modules, aliases, functions, circuits, global_consts)
|
||||
}
|
||||
}
|
||||
|
@ -396,6 +396,7 @@ pub trait ReconstructingReducerProgram<'a>: ReconstructingReducerStatement<'a> {
|
||||
&mut self,
|
||||
input: Program<'a>,
|
||||
imported_modules: Vec<(String, Program<'a>)>,
|
||||
aliases: Vec<(String, &'a Alias<'a>)>,
|
||||
functions: Vec<(String, &'a Function<'a>)>,
|
||||
circuits: Vec<(String, &'a Circuit<'a>)>,
|
||||
global_consts: Vec<(String, &'a DefinitionStatement<'a>)>,
|
||||
@ -405,6 +406,7 @@ pub trait ReconstructingReducerProgram<'a>: ReconstructingReducerStatement<'a> {
|
||||
id: input.id,
|
||||
name: input.name,
|
||||
imported_modules: imported_modules.into_iter().collect(),
|
||||
aliases: aliases.into_iter().collect(),
|
||||
functions: functions.into_iter().collect(),
|
||||
circuits: circuits.into_iter().collect(),
|
||||
scope: input.scope,
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{AsgContext, Circuit, DefinitionStatement, Function, Input, Type, Variable};
|
||||
use crate::{Alias, AsgContext, Circuit, DefinitionStatement, Function, Input, Type, Variable};
|
||||
use leo_errors::{AsgError, Result, Span};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
@ -37,6 +37,9 @@ pub struct Scope<'a> {
|
||||
/// Maps variable name => variable.
|
||||
pub variables: RefCell<IndexMap<String, &'a Variable<'a>>>,
|
||||
|
||||
/// Maps alias name => alias.
|
||||
pub aliases: RefCell<IndexMap<String, &'a Alias<'a>>>,
|
||||
|
||||
/// Maps function name => function.
|
||||
pub functions: RefCell<IndexMap<String, &'a Function<'a>>>,
|
||||
|
||||
@ -100,6 +103,22 @@ impl<'a> Scope<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns a reference to the alias corresponding to the name.
|
||||
///
|
||||
/// If the current scope did not have this name present, then the parent scope is checked.
|
||||
/// If there is no parent scope, then `None` is returned.
|
||||
///
|
||||
pub fn resolve_alias(&self, name: &str) -> Option<&'a Alias<'a>> {
|
||||
if let Some(resolved) = self.aliases.borrow().get(name) {
|
||||
Some(*resolved)
|
||||
} else if let Some(resolved) = self.parent_scope.get() {
|
||||
resolved.resolve_alias(name)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns a reference to the function corresponding to the name.
|
||||
///
|
||||
@ -141,6 +160,7 @@ impl<'a> Scope<'a> {
|
||||
id: self.context.get_id(),
|
||||
parent_scope: Cell::new(Some(self)),
|
||||
variables: RefCell::new(IndexMap::new()),
|
||||
aliases: RefCell::new(IndexMap::new()),
|
||||
functions: RefCell::new(IndexMap::new()),
|
||||
circuits: RefCell::new(IndexMap::new()),
|
||||
global_consts: RefCell::new(IndexMap::new()),
|
||||
@ -179,10 +199,15 @@ impl<'a> Scope<'a> {
|
||||
.collect::<Result<Vec<_>>>()?,
|
||||
),
|
||||
SelfType => return Err(AsgError::unexpected_big_self(span).into()),
|
||||
CircuitOrAlias(name) => Type::Circuit(
|
||||
self.resolve_circuit(&name.name)
|
||||
.ok_or_else(|| AsgError::unresolved_circuit(&name.name, &name.span))?,
|
||||
),
|
||||
CircuitOrAlias(name) => {
|
||||
if let Some(circuit) = self.resolve_circuit(&name.name) {
|
||||
Type::Circuit(circuit)
|
||||
} else if let Some(alias) = self.resolve_alias(&name.name) {
|
||||
alias.represents.clone()
|
||||
} else {
|
||||
return Err(AsgError::unresolved_circuit(&name.name, &name.span).into());
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,6 @@
|
||||
use leo_ast::*;
|
||||
use leo_errors::{AstError, Result, Span};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
|
||||
/// Replace Self when it is in a enclosing circuit type.
|
||||
/// Error when Self is outside an enclosing circuit type.
|
||||
/// Tuple array types and expressions expand to nested arrays.
|
||||
@ -29,26 +27,26 @@ pub struct Canonicalizer {
|
||||
// If we are in a circuit keep track of the circuit name.
|
||||
circuit_name: Option<Identifier>,
|
||||
in_circuit: bool,
|
||||
alias_lookup: Box<dyn Fn(Identifier) -> Option<Alias>>,
|
||||
}
|
||||
|
||||
impl AstPass for Canonicalizer {
|
||||
fn do_pass(ast: Program) -> Result<Ast> {
|
||||
Ok(Ast::new(
|
||||
ReconstructingDirector::new(Self::new(ast.aliases.clone())).reduce_program(&ast)?,
|
||||
ReconstructingDirector::new(Self::default()).reduce_program(&ast)?,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl Canonicalizer {
|
||||
pub fn new(aliases: IndexMap<Identifier, Alias>) -> Self {
|
||||
impl Default for Canonicalizer {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
circuit_name: None,
|
||||
in_circuit: false,
|
||||
alias_lookup: Box::new(move |alias: Identifier| -> Option<Alias> { aliases.get(&alias).cloned() }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Canonicalizer {
|
||||
pub fn canonicalize_accesses(
|
||||
&mut self,
|
||||
start: Expression,
|
||||
@ -481,7 +479,7 @@ impl ReconstructingReducer for Canonicalizer {
|
||||
self.in_circuit = !self.in_circuit;
|
||||
}
|
||||
|
||||
fn reduce_type(&mut self, type_: &Type, new: Type, span: &Span) -> Result<Type> {
|
||||
fn reduce_type(&mut self, _type_: &Type, new: Type, span: &Span) -> Result<Type> {
|
||||
match new {
|
||||
Type::Array(type_, mut dimensions) => {
|
||||
if dimensions.is_zero() {
|
||||
@ -502,13 +500,6 @@ impl ReconstructingReducer for Canonicalizer {
|
||||
|
||||
Ok(array)
|
||||
}
|
||||
Type::CircuitOrAlias(identifier) => {
|
||||
if let Some(alias_type) = (self.alias_lookup)(identifier.clone()) {
|
||||
return self.reduce_type(type_, alias_type.represents, &alias_type.name.span);
|
||||
}
|
||||
|
||||
Ok(Type::CircuitOrAlias(identifier))
|
||||
}
|
||||
Type::SelfType if !self.in_circuit => Err(AstError::big_self_outside_of_circuit(span).into()),
|
||||
_ => Ok(new.clone()),
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ where
|
||||
program: &Program,
|
||||
expected_input: Vec<FunctionInput>,
|
||||
import_statements: Vec<ImportStatement>,
|
||||
empty_imports: IndexMap<String, Program>,
|
||||
empty_imports: IndexMap<Vec<String>, Program>,
|
||||
aliases: IndexMap<Identifier, Alias>,
|
||||
circuits: IndexMap<Identifier, Circuit>,
|
||||
functions: IndexMap<Identifier, Function>,
|
||||
@ -159,58 +159,11 @@ where
|
||||
resolved_packages.insert(package.clone(), resolved_package);
|
||||
}
|
||||
|
||||
// TODO copyable AST.
|
||||
/* for (package, symbol, span) in imported_symbols.into_iter() {
|
||||
let pretty_package = package.join(".");
|
||||
|
||||
let resolved_package = resolved_packages
|
||||
.get_mut(&package)
|
||||
.expect("could not find preloaded package");
|
||||
|
||||
match symbol {
|
||||
ImportSymbol::All => {
|
||||
aliases.extend(resolved_package.aliases.clone().into_iter());
|
||||
functions.extend(resolved_package.functions.clone().into_iter());
|
||||
circuits.extend(resolved_package.circuits.clone().into_iter());
|
||||
global_consts.extend(resolved_package.global_consts.clone().into_iter());
|
||||
}
|
||||
ImportSymbol::Direct(name) => {
|
||||
if let Some(alias) = resolved_package.aliases.get(&name) {
|
||||
aliases.insert(name.clone(), alias.clone());
|
||||
} else if let Some(function) = resolved_package.functions.get(&name) {
|
||||
functions.insert(name.clone(), function.clone());
|
||||
} else if let Some(circuit) = resolved_package.circuits.get(&name) {
|
||||
circuits.insert(name.clone(), circuit.clone());
|
||||
} else if let Some(global_const) = resolved_package.global_consts.get(&name) {
|
||||
global_consts.insert(name.clone(), global_const.clone());
|
||||
} else {
|
||||
return Err(AstError::unresolved_import(pretty_package, &span).into());
|
||||
}
|
||||
}
|
||||
ImportSymbol::Alias(name, alias) => {
|
||||
if let Some(type_alias) = resolved_package.aliases.get(&name) {
|
||||
aliases.insert(alias.clone(), type_alias.clone());
|
||||
} else if let Some(function) = resolved_package.functions.get(&name) {
|
||||
functions.insert(alias.clone(), function.clone());
|
||||
} else if let Some(circuit) = resolved_package.circuits.get(&name) {
|
||||
circuits.insert(alias.clone(), circuit.clone());
|
||||
} else if let Some(global_const) = resolved_package.global_consts.get(&name) {
|
||||
global_consts.insert(alias.clone(), global_const.clone());
|
||||
} else {
|
||||
return Err(AstError::unresolved_import(pretty_package, &span).into());
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
Ok(Program {
|
||||
name: program.name.clone(),
|
||||
expected_input,
|
||||
import_statements,
|
||||
imports: resolved_packages
|
||||
.into_iter()
|
||||
.map(|(package, program)| (package.join("."), program))
|
||||
.collect(),
|
||||
imports: resolved_packages,
|
||||
aliases,
|
||||
circuits,
|
||||
functions,
|
||||
|
@ -15,6 +15,7 @@
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{Identifier, Type};
|
||||
use leo_errors::Span;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
@ -23,6 +24,7 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct Alias {
|
||||
pub name: Identifier,
|
||||
pub span: Span,
|
||||
pub represents: Type,
|
||||
}
|
||||
|
||||
|
49
ast/src/common/imported_modules.rs
Normal file
49
ast/src/common/imported_modules.rs
Normal file
@ -0,0 +1,49 @@
|
||||
// Copyright (C) 2019-2021 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::Program;
|
||||
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
|
||||
#[allow(clippy::ptr_arg)]
|
||||
pub fn serialize<S: Serializer>(
|
||||
imported_modules: &IndexMap<Vec<String>, Program>,
|
||||
serializer: S,
|
||||
) -> Result<S::Ok, S::Error> {
|
||||
let joined: IndexMap<String, Program> = imported_modules
|
||||
.into_iter()
|
||||
.map(|(package, program)| (package.join("."), program.clone()))
|
||||
.collect();
|
||||
|
||||
joined.serialize(serializer)
|
||||
}
|
||||
|
||||
pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result<IndexMap<Vec<String>, Program>, D::Error> {
|
||||
Ok(IndexMap::<String, Program>::deserialize(deserializer)?
|
||||
.into_iter()
|
||||
.map(|(package, program)| {
|
||||
(
|
||||
package
|
||||
.split('.')
|
||||
.map(|segment| segment.to_string())
|
||||
.collect::<Vec<String>>(),
|
||||
program,
|
||||
)
|
||||
})
|
||||
.collect())
|
||||
}
|
@ -23,6 +23,9 @@ pub use const_self_keyword::*;
|
||||
pub mod identifier;
|
||||
pub use identifier::*;
|
||||
|
||||
pub mod imported_modules;
|
||||
pub use imported_modules::*;
|
||||
|
||||
pub mod mut_self_keyword;
|
||||
pub use mut_self_keyword::*;
|
||||
|
||||
|
@ -45,7 +45,7 @@ impl fmt::Display for ValueExpression {
|
||||
Char(character) => write!(f, "{}", character),
|
||||
Field(field, _) => write!(f, "{}", field),
|
||||
Implicit(implicit, _) => write!(f, "{}", implicit),
|
||||
Integer(value, type_, _) => write!(f, "{}{}", value, type_),
|
||||
Integer(type_, value, _) => write!(f, "{}{}", value, type_),
|
||||
Group(group) => write!(f, "{}", group),
|
||||
String(string, _) => {
|
||||
for character in string.iter() {
|
||||
|
@ -29,7 +29,8 @@ pub struct Program {
|
||||
pub name: String,
|
||||
pub expected_input: Vec<FunctionInput>,
|
||||
pub import_statements: Vec<ImportStatement>,
|
||||
pub imports: IndexMap<String, Program>,
|
||||
#[serde(with = "crate::common::imported_modules")]
|
||||
pub imports: IndexMap<Vec<String>, Program>,
|
||||
pub aliases: IndexMap<Identifier, Alias>,
|
||||
pub circuits: IndexMap<Identifier, Circuit>,
|
||||
pub global_consts: IndexMap<String, DefinitionStatement>,
|
||||
|
@ -438,6 +438,7 @@ impl<R: ReconstructingReducer> ReconstructingDirector<R> {
|
||||
name.clone(),
|
||||
Alias {
|
||||
name: alias.name.clone(),
|
||||
span: alias.span.clone(),
|
||||
represents,
|
||||
},
|
||||
);
|
||||
@ -516,8 +517,8 @@ impl<R: ReconstructingReducer> ReconstructingDirector<R> {
|
||||
self.reducer.reduce_import_statement(import, package_or_packages)
|
||||
}
|
||||
|
||||
pub fn reduce_import(&mut self, identifier: &str, import: &Program) -> Result<(String, Program)> {
|
||||
let new_identifer = identifier.to_string();
|
||||
pub fn reduce_import(&mut self, identifier: &[String], import: &Program) -> Result<(Vec<String>, Program)> {
|
||||
let new_identifer = identifier.to_vec();
|
||||
let new_import = self.reduce_program(import)?;
|
||||
self.reducer.reduce_import(new_identifer, new_import)
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ pub trait ReconstructingReducer {
|
||||
program: &Program,
|
||||
expected_input: Vec<FunctionInput>,
|
||||
import_statements: Vec<ImportStatement>,
|
||||
imports: IndexMap<String, Program>,
|
||||
imports: IndexMap<Vec<String>, Program>,
|
||||
aliases: IndexMap<Identifier, Alias>,
|
||||
circuits: IndexMap<Identifier, Circuit>,
|
||||
functions: IndexMap<Identifier, Function>,
|
||||
@ -439,7 +439,7 @@ pub trait ReconstructingReducer {
|
||||
})
|
||||
}
|
||||
|
||||
fn reduce_import(&mut self, identifier: String, import: Program) -> Result<(String, Program)> {
|
||||
fn reduce_import(&mut self, identifier: Vec<String>, import: Program) -> Result<(Vec<String>, Program)> {
|
||||
Ok((identifier, import))
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ impl<R: ReconstructingReducer, O: CombinerOptions> CombineAstAsgDirector<R, O> {
|
||||
|
||||
AstType::Tuple(reduced_types)
|
||||
}
|
||||
_ if self.options.type_inference_enabled() => asg.into(),
|
||||
_ => ast.clone(),
|
||||
};
|
||||
|
||||
|
@ -130,29 +130,3 @@ impl LeoError {
|
||||
|
||||
/// A global result type for all Leo crates, that defaults the errors to be a LeoError.
|
||||
pub type Result<T, E = LeoError> = core::result::Result<T, E>;
|
||||
|
||||
// #[test]
|
||||
// fn test_error() {
|
||||
// let err = FormattedError {
|
||||
// path: std::sync::Arc::new("file.leo".to_string()),
|
||||
// line_start: 2,
|
||||
// line_stop: 2,
|
||||
// col_start: 9,
|
||||
// col_stop: 10,
|
||||
// content: "let a = x;".into(),
|
||||
// message: "undefined value `x`".to_string(),
|
||||
// };
|
||||
|
||||
// assert_eq!(
|
||||
// err.to_string(),
|
||||
// vec![
|
||||
// " --> file.leo:2:9",
|
||||
// " |",
|
||||
// " 2 | let a = x;",
|
||||
// " | ^",
|
||||
// " |",
|
||||
// " = undefined value `x`",
|
||||
// ]
|
||||
// .join("\n")
|
||||
// );
|
||||
// }
|
||||
|
@ -534,6 +534,7 @@ impl ParserContext {
|
||||
name.clone(),
|
||||
Alias {
|
||||
represents: type_,
|
||||
span: name.span.clone(),
|
||||
name,
|
||||
},
|
||||
))
|
||||
|
@ -7,9 +7,9 @@
|
||||
"circuits": {},
|
||||
"global_consts": {},
|
||||
"functions": {
|
||||
"main": {
|
||||
"{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() -> u8 {\\\"}\"}": {
|
||||
"annotations": [],
|
||||
"identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"C:\\\\\\\\Users\\\\\\\\jonat\\\\\\\\AppData\\\\\\\\Roaming\\\\\\\\work\\\\\\\\tester\\\\\\\\src/main.leo\\\",\\\"content\\\":\\\"function main() -> u8 {\\\"}\"}",
|
||||
"identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() -> u8 {\\\"}\"}",
|
||||
"input": [],
|
||||
"output": {
|
||||
"IntegerType": "U8"
|
||||
@ -30,7 +30,7 @@
|
||||
"line_stop": 2,
|
||||
"col_start": 12,
|
||||
"col_stop": 15,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": " return 1u8 + 1u8;"
|
||||
}
|
||||
]
|
||||
@ -46,7 +46,7 @@
|
||||
"line_stop": 2,
|
||||
"col_start": 18,
|
||||
"col_stop": 21,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": " return 1u8 + 1u8;"
|
||||
}
|
||||
]
|
||||
@ -58,7 +58,7 @@
|
||||
"line_stop": 2,
|
||||
"col_start": 12,
|
||||
"col_stop": 21,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": " return 1u8 + 1u8;"
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@
|
||||
"line_stop": 2,
|
||||
"col_start": 5,
|
||||
"col_stop": 21,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": " return 1u8 + 1u8;"
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@
|
||||
"line_stop": 3,
|
||||
"col_start": 23,
|
||||
"col_stop": 2,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": "function main() -> u8 {\n ...\n}"
|
||||
}
|
||||
},
|
||||
@ -88,7 +88,7 @@
|
||||
"line_stop": 3,
|
||||
"col_start": 1,
|
||||
"col_stop": 2,
|
||||
"path": "C:\\Users\\jonat\\AppData\\Roaming\\work\\tester\\src/main.leo",
|
||||
"path": "",
|
||||
"content": "function main() -> u8 {\n ...\n}"
|
||||
}
|
||||
}
|
||||
|
@ -28,9 +28,19 @@ fn to_ast(program_filepath: &Path) -> Result<Ast> {
|
||||
leo_parser::parse_ast("test", &program_string)
|
||||
}
|
||||
|
||||
fn setup() {
|
||||
std::env::set_var("LEO_TESTFRAMEWORK", "true");
|
||||
}
|
||||
|
||||
fn clean() {
|
||||
std::env::remove_var("LEO_TESTFRAMEWORK");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "ci_skip"))]
|
||||
fn test_serialize() {
|
||||
setup();
|
||||
|
||||
// Construct an ast from the given test file.
|
||||
let ast = {
|
||||
let mut program_filepath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
@ -45,12 +55,16 @@ fn test_serialize() {
|
||||
// Load the expected ast.
|
||||
let expected: Program = serde_json::from_str(include_str!("expected_leo_ast.json")).unwrap();
|
||||
|
||||
clean();
|
||||
assert_eq!(expected, serialized_ast);
|
||||
}
|
||||
|
||||
#[test]
|
||||
// TODO Renable when we don't write spans to snapshots.
|
||||
/* #[test]
|
||||
#[cfg(not(feature = "ci_skip"))]
|
||||
fn test_deserialize() {
|
||||
setup();
|
||||
|
||||
// Load the expected ast.
|
||||
let expected_ast = {
|
||||
let mut program_filepath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
@ -63,11 +77,14 @@ fn test_deserialize() {
|
||||
let serialized_ast = include_str!("expected_leo_ast.json");
|
||||
let ast = Ast::from_json_string(serialized_ast).unwrap();
|
||||
|
||||
clean();
|
||||
assert_eq!(expected_ast, ast);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialize_deserialize_serialize() {
|
||||
setup();
|
||||
|
||||
// Construct an ast from the given test file.
|
||||
let ast = {
|
||||
let mut program_filepath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
@ -85,11 +102,14 @@ fn test_serialize_deserialize_serialize() {
|
||||
// Reserializes the ast into JSON format.
|
||||
let reserialized_ast = ast.to_json_string().unwrap();
|
||||
|
||||
clean();
|
||||
assert_eq!(serialized_ast, reserialized_ast);
|
||||
}
|
||||
} */
|
||||
|
||||
#[test]
|
||||
fn test_generic_parser_error() {
|
||||
setup();
|
||||
|
||||
let error_result = {
|
||||
let mut program_filepath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
program_filepath.push("tests/serialization/parser_error.leo");
|
||||
@ -98,5 +118,6 @@ fn test_generic_parser_error() {
|
||||
}
|
||||
.map_err(|err| matches!(err, LeoError::ParserError(_)));
|
||||
|
||||
clean();
|
||||
assert!(error_result.err().unwrap());
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ fn run_with_args(opt: Opt) -> Result<(), Box<dyn Error>> {
|
||||
cwd.pop();
|
||||
cwd.join(&val.as_str().unwrap())
|
||||
})
|
||||
.unwrap_or(PathBuf::from(path));
|
||||
.unwrap_or_else(|| PathBuf::from(path));
|
||||
|
||||
// Write all files into the directory.
|
||||
let (initial, canonicalized, type_inferenced) = generate_asts(cwd, text)?;
|
||||
@ -130,22 +130,16 @@ fn run_with_args(opt: Opt) -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
|
||||
/// Do what Compiler does - prepare 3 stages of AST: initial, canonicalized and type_inferenced
|
||||
fn generate_asts(path: PathBuf, text: &String) -> Result<(String, String, String), Box<dyn Error>> {
|
||||
fn generate_asts(path: PathBuf, text: &str) -> Result<(String, String, String), Box<dyn Error>> {
|
||||
let mut ast = leo_parser::parse_ast(path.clone().into_os_string().into_string().unwrap(), text)?;
|
||||
let initial = ast.to_json_string()?;
|
||||
|
||||
ast = leo_ast_passes::Importer::do_pass(
|
||||
ast.into_repr(),
|
||||
ImportParser::new(path, Default::default()),
|
||||
)?;
|
||||
ast = leo_ast_passes::Importer::do_pass(ast.into_repr(), ImportParser::new(path, Default::default()))?;
|
||||
|
||||
ast = leo_ast_passes::Canonicalizer::do_pass(ast.into_repr())?;
|
||||
let canonicalized = ast.to_json_string()?;
|
||||
|
||||
let asg = Asg::new(
|
||||
thread_leaked_context(),
|
||||
&ast,
|
||||
)?;
|
||||
let asg = Asg::new(thread_leaked_context(), &ast)?;
|
||||
|
||||
let type_inferenced = TypeInferencePhase::default()
|
||||
.phase_ast(&ast.into_repr(), &asg.clone().into_repr())
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
a:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: d492cd0d2a37e95acfa5841c09d8c3238f6468087766de30d78081e63a31e109
|
||||
initial_ast: 32dcc6719d7d1214782cd1ffe02f067eec8adbf1f3820546e539887d4f1334c8
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: d492cd0d2a37e95acfa5841c09d8c3238f6468087766de30d78081e63a31e109
|
||||
type_inferenced_ast: b85a48e081e36b6e52c20147c403be350dcf3cff3505c021ff3465877e87fdff
|
||||
canonicalized_ast: 32dcc6719d7d1214782cd1ffe02f067eec8adbf1f3820546e539887d4f1334c8
|
||||
type_inferenced_ast: 996f46f1dba11bdde037a8e033ca97870871eb89d4e3e402b59f99fcc0c35323
|
||||
|
@ -22,7 +22,7 @@ outputs:
|
||||
a:
|
||||
type: bool
|
||||
value: "false"
|
||||
initial_ast: 7d74962f3929982b6671a5111305c4928834fc5643778e885919775de43710c4
|
||||
initial_ast: d9d5346dff8f825d58daabb3a4fe2fcd1471a3fb3c80e46e5583c4f6cdb12b2b
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 7d74962f3929982b6671a5111305c4928834fc5643778e885919775de43710c4
|
||||
type_inferenced_ast: a22a737b4c99d462273185aef1ec0df45bba973cd3336d303a804bd9bdfd993e
|
||||
canonicalized_ast: d9d5346dff8f825d58daabb3a4fe2fcd1471a3fb3c80e46e5583c4f6cdb12b2b
|
||||
type_inferenced_ast: 32a303da117b08aebfb74f7454cd80dfe28b07fd464a61b6d6a3ce23d451f135
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
a:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 2fb135abb6706ca3bbad3bf778f3a563b039aaaacf02f08a10a4b33876c258c3
|
||||
initial_ast: 9961e21337ff8eed0a27fff91fc442c2530a1bfaf80da6d497a93a371896b1f8
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 2fb135abb6706ca3bbad3bf778f3a563b039aaaacf02f08a10a4b33876c258c3
|
||||
type_inferenced_ast: 1f35b3671bbe648800bc2019091b2f39bab1c5fa381e33955589bd2721e7ac8a
|
||||
canonicalized_ast: 9961e21337ff8eed0a27fff91fc442c2530a1bfaf80da6d497a93a371896b1f8
|
||||
type_inferenced_ast: cc47000b2cf462f5cb891467cc99f2d21c44ced2198e988dc3de59f166aa1603
|
||||
|
@ -22,7 +22,7 @@ outputs:
|
||||
a:
|
||||
type: bool
|
||||
value: "false"
|
||||
initial_ast: 1b960dbe8ab26f12c2bee3a31a2539e1a51ed4c32ba6ad91a37fcb40c90d774a
|
||||
initial_ast: 6f8e7a94ccb702790204360959a2673abf6b53027fccaaa9feed8a4e41ee05c1
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 1b960dbe8ab26f12c2bee3a31a2539e1a51ed4c32ba6ad91a37fcb40c90d774a
|
||||
type_inferenced_ast: 1c0197b5a44656925345eae03e3989cef88ba31bb3f466d250b44d66c6a1163f
|
||||
canonicalized_ast: 6f8e7a94ccb702790204360959a2673abf6b53027fccaaa9feed8a4e41ee05c1
|
||||
type_inferenced_ast: 91e597663c88fbfd0c6ff787d109f5a71d5357c44d5306f7149714cda86475ae
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373019]: array index out of bounds: '0'\n --> compiler-test:7:24\n |\n 7 | const z: [u8; 2] = y[..1u32][..x];\n | ^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373019]: array index out of bounds: '0'\n --> compiler-test:7:24\n |\n 7 | const z: [u8; 2] = y[..1u32][..x];\n | ^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::array_index_out_of_bounds<usize>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_range_access::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_range_access.rs:198\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:318\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,13 +16,7 @@ outputs:
|
||||
out:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 989d9de839e0e74a27333a90066c5d7b1e1bd404a41e7f9e49a691360fb4d8dc
|
||||
initial_ast: 843884ddf198fe566cea0f8e84a2902f720d6211c9d8bad98299eea4da846870
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 0c65e90065d4363e1a51b3b7f3ec1e94281958fdbd76aa47b42ae678a2bf5042
|
||||
type_inferenced_ast: 3138d69d125bfe3f0eaaa85d52ffa5934a750274a4e8f031b4945f9d0d98c807
|
||||
=======
|
||||
initial_ast: 9a4630fa0959a626a26800f00d05a203e35f4389a9d17a6dc491eb725ef3a529
|
||||
canonicalized_ast: 6c7df16234b6b4d8aaa6ca1d761bcffb5b05893cc515b6f4d72118bc8e495b7e
|
||||
type_inferenced_ast: 4aa60801f15fb817e16eb9f9bd4d6bed555c9130d88edebb3ba78302879703a1
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: c30721e60523bc31af9a9bf342d9b89bf92a26e3886394cc0c1a574560715bdf
|
||||
type_inferenced_ast: c37f209961a9acff1d942af1e4a9a332123676f2bc581ca94604314f9d738a1e
|
||||
|
@ -22,7 +22,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "false"
|
||||
initial_ast: 6b674857eb55b26f41b867723574b0784057ba6dd8f95c7438c51ea93e73dec4
|
||||
initial_ast: aa24022f240400d709b97a44c143ce481109bb0a66926aa5c97cf2e2d06dea2a
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 69bf827f4094c87a47d4cb172a0e25e7392a18e32da033a690b149210cd77a15
|
||||
type_inferenced_ast: 00a6373a605c5a0566f4f88a59a8bcc636e6632abf60dfa9b889e735c3b41b61
|
||||
canonicalized_ast: ace5006c27d2e3784fb73d52adc641f6285a041452ba0d23de5983c5eede1139
|
||||
type_inferenced_ast: 611bc2fab64e417c9cfad3c59ca333561b8167a6fc7be957d972d96125e040ba
|
||||
|
@ -22,7 +22,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 680250e13fa265cc2131fb2b54bcccba0714728058d429caa88a29ac350b61d0
|
||||
initial_ast: 307b6817fa2a5005462686901129e97bf75c00bf14568fafbe1de2c8afc1804d
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 7c5b12eeb132c65757f301fc83107af5b0436ef3579c0d5fd4a3c594292f617b
|
||||
type_inferenced_ast: be6d04f8cd8d286a2b8723eceb397292b89faee3c912278bede0e2c630ceb1ee
|
||||
canonicalized_ast: cbaa304ba210d8155762701d8e6a2ddca3eaffb008a813ed7a60db1fb0043f10
|
||||
type_inferenced_ast: 47e371ce112ac17fd65bfd100d24829e8c4819e1f96cc715b8c6245f01d608bb
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: af8a0babe4fb6049ba8da55fb87056009c554565f211262164045229e4cfe4c4
|
||||
initial_ast: 6d5be1a3d383ecafa89b5327d3a4b9bce9a459f6c0241cb01f408566ec4a1cc4
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 3efc51fc953d0c6d3480250eebc4002ac77aab22bed6715950fb5a86b2acfbdf
|
||||
type_inferenced_ast: cbbdf19b20f72a87c3e35fc86771404366d45750d8774362813eea54dca36d88
|
||||
canonicalized_ast: eb64230be87deb03ac7f076961a82194a15afd964aa6966a10314b38def69684
|
||||
type_inferenced_ast: e7985a24db781a3e42c9b2a67d1e8febc78fc2ad4e388a90207d00eb89734ffd
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 6b674857eb55b26f41b867723574b0784057ba6dd8f95c7438c51ea93e73dec4
|
||||
initial_ast: aa24022f240400d709b97a44c143ce481109bb0a66926aa5c97cf2e2d06dea2a
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 69bf827f4094c87a47d4cb172a0e25e7392a18e32da033a690b149210cd77a15
|
||||
type_inferenced_ast: 00a6373a605c5a0566f4f88a59a8bcc636e6632abf60dfa9b889e735c3b41b61
|
||||
canonicalized_ast: ace5006c27d2e3784fb73d52adc641f6285a041452ba0d23de5983c5eede1139
|
||||
type_inferenced_ast: 611bc2fab64e417c9cfad3c59ca333561b8167a6fc7be957d972d96125e040ba
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 1'\n --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions\n | ^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 1'\n --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions\n | ^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 1fcce69ea40899b3aee6364831293911bab0c05f1ab7d2cb32f76c75bd8e137d
|
||||
initial_ast: 0724c81ae70c56ff047b5d28ef949b72c4b581ce0bb443957064efa1636a3cab
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 55ba114499167abcef669fae7c8f7a3ecf5079314fd8991f07ac6c9b33587e14
|
||||
type_inferenced_ast: 8b0018337505d01dc46a1c2a4374ae56b0eb04bf9ba7f49bec20c7ec1dd3b5b2
|
||||
canonicalized_ast: ed0b7200a455978fed9b1df0c9e3ab9bf4815d79048f28f4205c69b420ee02df
|
||||
type_inferenced_ast: 1e5c78e15d8c9328190e95ccbc2e4e105d9ce430b98704a12472e2c3cc870526
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 4e0ced7473bd388bd7ae1af07db63dc65622420c845ea69980480ec23c83b908
|
||||
initial_ast: 60d0b81c9f3631aca3c9607df74cfb8e4dbc0d387836398dea86f016fa4210fd
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: d09993599a5173bcfc36ed35840f84b89dcd9a48132d3233a7848fc993679af8
|
||||
type_inferenced_ast: be6990d86c00f0f5158e4bb8b9b20355a714612a6a9ac6dc0e9bca7b981ca87e
|
||||
canonicalized_ast: 6570de0e96b21780ed7793a860948b2c6ff7a92da7ce7f3dd7775ff30d70656f
|
||||
type_inferenced_ast: ace51ab56a61b988bd2c3f65431e87234a96fa92554d36d4e83d7235832506f6
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 0193a42a8f03491f67d65da8c5be336997c400571692d0dd55c601ccb8cc57c4
|
||||
initial_ast: 754eca05d485d80c4b710db30efc66f91c0eafdc02c2707f854238863b6c6c02
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 6816489a1129eb78fe392a67438f3c0d9a7a2a6f83075dae4c9cd437d5e3e89a
|
||||
type_inferenced_ast: e18fde7d689c25cef43935985939ba4bf4210ce44df19fc93fbdf9ac855ee175
|
||||
canonicalized_ast: e5554c42dc9a45ab57ea5ac28996969640fb6f8da1ad8db805f65f5d555c8cf4
|
||||
type_inferenced_ast: aa30bccd05b7386ffb8a7df7cad89ec39117c6b5fc51a9e68624064832b4f225
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:6:30\n |\n 6 | const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:6:30\n |\n 6 | const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -22,13 +22,7 @@ outputs:
|
||||
r:
|
||||
type: "[u8; 3]"
|
||||
value: "\"123\""
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 5b224262cdf11d2a6e114637866c5768c6013ceea2a7602884bddf470652fd84
|
||||
initial_ast: 4e74124bc410534941ef9b79ffb64656d14e145b5a79fbd14419c1aef2f0ef69
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 5b224262cdf11d2a6e114637866c5768c6013ceea2a7602884bddf470652fd84
|
||||
type_inferenced_ast: 900f2882fecb7096f0862b05fa64bd9c0a8d51ae4fb255994062234e9451acf2
|
||||
=======
|
||||
initial_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a
|
||||
canonicalized_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a
|
||||
type_inferenced_ast: cf35fa9ca18f19ac75ca522a77e310b02ff56ac1d748cd5df5c2204bba4a4802
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 4e74124bc410534941ef9b79ffb64656d14e145b5a79fbd14419c1aef2f0ef69
|
||||
type_inferenced_ast: f5cb6326028b3cf9187889be6ac5ed5bd095a570d45ae63c7285a09366fc6803
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 084f8628f6a17bf7a6c1b0e4398120f17064a0b997b1f5d6cc27e938acc5fe58
|
||||
initial_ast: 0e4761ba1228f0a490b51ff2c31df33f623a08d32f62833d64859ca103689f4a
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 084f8628f6a17bf7a6c1b0e4398120f17064a0b997b1f5d6cc27e938acc5fe58
|
||||
type_inferenced_ast: c028d0f4e399802beec7a0ea559aa46e052ac2a32455d1b81001592b874c72a6
|
||||
canonicalized_ast: 0e4761ba1228f0a490b51ff2c31df33f623a08d32f62833d64859ca103689f4a
|
||||
type_inferenced_ast: 1494bb64c16ec2dc03bfb2e37b89f93e02a70860ced1ce0b42b5ee5ead31b0d5
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 70b1ba2b0a46b1ea06adca06dd2210b366511bb940e9eadf17a1642bcf973b6d
|
||||
initial_ast: 1bf9b30e052d9ecc042a0b20bbc195a98d463ab206963469b9199de462b8be15
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 70b1ba2b0a46b1ea06adca06dd2210b366511bb940e9eadf17a1642bcf973b6d
|
||||
type_inferenced_ast: a8780032bd5da61c1437923b6d589805e4ba9ea7888b70ea157b534a1a577e9d
|
||||
canonicalized_ast: 1bf9b30e052d9ecc042a0b20bbc195a98d463ab206963469b9199de462b8be15
|
||||
type_inferenced_ast: 6d2531af8ed5b04b23039d0b508cf388135a0fc6e1dc0de3befb4d49ce360fbc
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: ab85c06a01efa81e861a5ade874b58d30ff6490a929d730f35f1b27545dbd23d
|
||||
initial_ast: 140097342b7a16fae8542da5d13eb9c2cb4e1b743fa226e345d815f62d0781bb
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: ab85c06a01efa81e861a5ade874b58d30ff6490a929d730f35f1b27545dbd23d
|
||||
type_inferenced_ast: 3f896ba9110807abc3361db1dca3fcc4b8855430cdd6d7661a7cb2c34d2a7a56
|
||||
canonicalized_ast: 140097342b7a16fae8542da5d13eb9c2cb4e1b743fa226e345d815f62d0781bb
|
||||
type_inferenced_ast: a2442e72c5010224894e46a1c6f245356c0d86428ce617eb31faaf57806ca2df
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: bd023884e72257d4eb740a5c946c2a3e8bacef53b53b6b6feb7b1ecb6b711d4e
|
||||
initial_ast: 002cb467a5c1357617b45f955944bb4a79ab465dc13f3eb5eb8db4c158b8c745
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: bd023884e72257d4eb740a5c946c2a3e8bacef53b53b6b6feb7b1ecb6b711d4e
|
||||
type_inferenced_ast: f828025dfee39cb802b7ce7b33725595da817a232d89c272b1ec45dbd2d7ba34
|
||||
canonicalized_ast: 002cb467a5c1357617b45f955944bb4a79ab465dc13f3eb5eb8db4c158b8c745
|
||||
type_inferenced_ast: 323fc99ac247b37bb395eb08691d451a3b6b563a15bb94b5af6a0193ccc0bd34
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 72dc367392ae59242e3ccec58687c10b821d65a75c7a458fd9443a336d25ddfb
|
||||
initial_ast: 97fd9b78f7912a7627e2b2f5615ae35e39304af6122fab85f9b49fcf6a85d8f2
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 1cba21237437f3d4fb3f87c803bae422c1a1bdf68439b03623c9fc5fc0402551
|
||||
type_inferenced_ast: fbe6a5577a77aea2faacdd582a6835b43ee850e9be3bc306aa263bf40a7cc9c9
|
||||
canonicalized_ast: cf8a8faae5f2847199324cbef87583e9af1249c03891ae31f3ce0093879326d5
|
||||
type_inferenced_ast: 731117b4aa8260da475471088df325cb540d84c536ce60f3488e01a4428e84ae
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:5:30\n |\n 5 | const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:5:30\n |\n 5 | const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 84eccc4c4a18448bdc05e06bbf6e2cccd0eb6e13fcad496c70a6f243b43171e4
|
||||
initial_ast: 9f2080fab6a85294afa2423cd79482fb3d944c4afab7363e66a4086a120ad34d
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 84eccc4c4a18448bdc05e06bbf6e2cccd0eb6e13fcad496c70a6f243b43171e4
|
||||
type_inferenced_ast: 5a3062bedba71604ebbdc70bc72178548a1093884e2da7df3a99f8e006e7a26b
|
||||
canonicalized_ast: 9f2080fab6a85294afa2423cd79482fb3d944c4afab7363e66a4086a120ad34d
|
||||
type_inferenced_ast: f8c6b9a9ac418220c87bbd1a99a5eb15817cfa289d822624f2d3cc41e10718b4
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: bbe30eb03afa974721e3cf40bef574b74ec582f20b7b14db074fd670127a8c87
|
||||
initial_ast: f61370b311806223d351c6dd611a178362cf8ad6de976d7b0ed709b51fadbecb
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: bbe30eb03afa974721e3cf40bef574b74ec582f20b7b14db074fd670127a8c87
|
||||
type_inferenced_ast: db83c5bbcb901c43d8be3f02cc846a74613e168743bc5f9e897e09cbee6502a7
|
||||
canonicalized_ast: f61370b311806223d351c6dd611a178362cf8ad6de976d7b0ed709b51fadbecb
|
||||
type_inferenced_ast: 54531d6afced0deaa59c93b9270768a5e89ea8ea1df34365eb4e440bdf725904
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 06f8897739a085abf7d3f2c1b0dfbbf698f6d53fdfb8e6f02083160217808da6
|
||||
initial_ast: 6bacdd1d42bfa807910c0455c68213007d5ca8f15ee1f3c743d946bfbbff79b7
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 06f8897739a085abf7d3f2c1b0dfbbf698f6d53fdfb8e6f02083160217808da6
|
||||
type_inferenced_ast: 1ffd5a3afdc6c8178f3f1aac2209967aa99c78550bb804cff7191e0d0716cc73
|
||||
canonicalized_ast: 6bacdd1d42bfa807910c0455c68213007d5ca8f15ee1f3c743d946bfbbff79b7
|
||||
type_inferenced_ast: 1b2a08879a8d42fafc9eecc12b89f0f36719e02205ee48bf6075475e71942132
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: a3c8beaeccc1be4a6c50b651612695e6c31452763f20ad493de49c84fd86e8ff
|
||||
initial_ast: c3c30cd2e66f21abef8c49e0ac3d49ed3b607097815c354b14ea9e44d41c0a69
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: a3c8beaeccc1be4a6c50b651612695e6c31452763f20ad493de49c84fd86e8ff
|
||||
type_inferenced_ast: 9934056872c421fe07878fc155a153414b80d96c2d5a227acca86e0cd5b80e96
|
||||
canonicalized_ast: c3c30cd2e66f21abef8c49e0ac3d49ed3b607097815c354b14ea9e44d41c0a69
|
||||
type_inferenced_ast: 557825e28344c8313d9961f9551eabe9c32ee85c524b9b9a6b0fc202c22fa9f3
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 1bdcbe987930954d6f0f3bdc5c7c2b35846fdf7b996265bf3a2e62a2ecaae4e4
|
||||
initial_ast: 6c062f01a78d515f780a4c13de65d466edda274a2cb519af47a319ed165db0fa
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: e7648a9d0d98031d1dc0f19529be3cf02420401a6f137f68b1baf55d8c0c55b6
|
||||
type_inferenced_ast: 993f6d78fb3365e2da39f6d03e07fa5b4c372873f08028f23d69c323043e32f9
|
||||
canonicalized_ast: 382e9b8b4a635b0be6f62409a20bbdc10d37d08c17658414d1ddef8e6eb00749
|
||||
type_inferenced_ast: 13d8af6038fbc63ae76be51f23e43152ab473b895d206160716008da87da3416
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: ee637fa4a96ec17f71ef4e6a366a4cba6b831f8fe991ca1eb55781bd3d98c09e
|
||||
initial_ast: 228ba794b578de8828d761676c15059c51455aff96b02ef3cfafbef53c35454b
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 9d269327b06ac400153b6875c0ddf3a99fb11d9e57714aa3e794f6f2a5cf738a
|
||||
type_inferenced_ast: 995a49ab97b5ad070ee47bc29852df15b1253b79aacb664d92795daf0cc39d92
|
||||
canonicalized_ast: 7869bd9531ba014bc2515e13bcafdfed2f9566e7008c1e015d43bb749d8d1d4a
|
||||
type_inferenced_ast: 84b8976993f08b1b46fef6012018ad050eed6df1e34ae83fc0b57799a1acb395
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 19b184f74b0349d571253403e32572a211860bd807ab756141e43d9eda3fbe09
|
||||
initial_ast: 0ea5856bbe7ad96107544e2b12c7ca54c279c4cd1c8b9610083430600ffa86f9
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 365d7f42b5715b050c445fcaaca98573f3c545fc47d9f2973142e131571e56f2
|
||||
type_inferenced_ast: 87b314c4de2463998ed3837ce087cbe1e623303ab8123f6a723fbecaf209370a
|
||||
canonicalized_ast: 0083c78a81a6ec44627ca89fe949a5301ccaa54ead7104b9a2a3fbd979cf9a2c
|
||||
type_inferenced_ast: a8b44ce543535e16db5d93df805dc5693d3a1140798cb336d573986de8dfdbca
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: d38643e491aed9c0d08573c4254676a75e1cf0cb24477ed8193f0d529bc70185
|
||||
initial_ast: db7e9050580f794aa657700225126e8033c0241240874f6e35df0507469be247
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 240aabd0b9a1fd9394e3e779832d352ee7fc6740e4ad93549ccf44eaf0059ac6
|
||||
type_inferenced_ast: e305aa4a4b91099770e4d72c00b6cc313b359877831fd0ea72ccbfa723a8a225
|
||||
canonicalized_ast: 55304d82a024ad2418e156ad661224040904775f070995bf1b828d1264c3487f
|
||||
type_inferenced_ast: db99dd94ad4ef9de46304df000494eeda3e8b51835c46e6a3988ee87f91457fa
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: b629f99223795b499451e3cf6db866e47e591a551627cf8ddfb00d51db4ed4e2
|
||||
initial_ast: 2730f954bc76f81d29b02a15f8025d75ca963234716112745b806789bb8eb297
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 1a0501460bde120818e2ef303c18e3fb821e65adf234594e746a5af65feccf0a
|
||||
type_inferenced_ast: b5ffc8d9878c4e9ffac33e1965404c2a0250d18d3776fd5a40d2723ae4a70b97
|
||||
canonicalized_ast: 4e07d5e399fa0f60ab84796ecc6195b2a8da0b3a9e725152465512e98f0ca753
|
||||
type_inferenced_ast: ea0f726ce456c52c62b73aae38afb74b160ae527480d05f3254c0fdaefdad58e
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 4693bcd676e482d4379e849f4e34c9c9d6e5c7c00984e5c648180a9e76419c05
|
||||
initial_ast: 445b35e7d287dc14a77b2c1c4c77d9b7b4fbd6e7c31f6f35c91a446eeca29775
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 32e3f6d6eb01d8b5c7c6151d49f9317ffa5f0ac3d351d2f5d84f067d478b0e93
|
||||
type_inferenced_ast: 85d1a53d54722335db82efc0e8d1c04d487cfdec2b6b6c2131f65de6758d231d
|
||||
canonicalized_ast: 48590d7afce08e9e0cd4a45048faa360c18109098b5a9074dfc21b252a47d3e8
|
||||
type_inferenced_ast: 0cc5d17973908631180a791f151bdc42aa3e8394b3fbc7607f717bc61baaf904
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order)\n | ^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373025]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order)\n | ^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::unexpected_type<alloc::string::String,alloc::string::String>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::array_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\array_init.rs:96\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:312\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
File diff suppressed because one or more lines are too long
@ -34,7 +34,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: e9685b77cd864e4d501b3833d59cbd179cc7caa71f13adf51a69c04b73751871
|
||||
initial_ast: 2f7c3b9c806a873b6445200eb78a8e0e546ffe64c90fe2133355dd37a342b11b
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: e9685b77cd864e4d501b3833d59cbd179cc7caa71f13adf51a69c04b73751871
|
||||
type_inferenced_ast: 49c6fd3ae2a94863d0bd458434836f9a06977a452f53a92a09675d540f3cd506
|
||||
canonicalized_ast: 2f7c3b9c806a873b6445200eb78a8e0e546ffe64c90fe2133355dd37a342b11b
|
||||
type_inferenced_ast: 87b86a66fc6e60502be0b0fb7cf677d5128390aec53f6893827a1bf02fca8370
|
||||
|
@ -34,7 +34,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 6b1d6535965e03187f0831767fdc168af95613e70175a05fcc226ae70f4667df
|
||||
initial_ast: 5316ba00882aa3f9b538d349ed7141c4ee7c77ec01f6af9911b2652b6cd3e659
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 6b1d6535965e03187f0831767fdc168af95613e70175a05fcc226ae70f4667df
|
||||
type_inferenced_ast: 9da0ef947f21d23ec506a8cdc4bf63d5c2a533f60f14a7597ae2865a98b48ab8
|
||||
canonicalized_ast: 5316ba00882aa3f9b538d349ed7141c4ee7c77ec01f6af9911b2652b6cd3e659
|
||||
type_inferenced_ast: 7933d0a8f47892e42c3c670bc6433e8d820042a7396e10b6a63d22bd5b740f96
|
||||
|
@ -34,7 +34,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 0ccc0ba25764d2533805bfc569d796cba88c82ad7135a874e5ff60ecf29fc576
|
||||
initial_ast: 08f026e24cab51634a7a2a6f1f3b082eace1d4be649cd9ff7c244194891d7d78
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 0ccc0ba25764d2533805bfc569d796cba88c82ad7135a874e5ff60ecf29fc576
|
||||
type_inferenced_ast: c85eeb8262aad7558bb8a61b78a33b3c7c644dd8e93456cb8cc8bfdfc13c12ba
|
||||
canonicalized_ast: 08f026e24cab51634a7a2a6f1f3b082eace1d4be649cd9ff7c244194891d7d78
|
||||
type_inferenced_ast: 2112e9f631a77bb16ba1561bbe1028a415413f23fd32d21bfe086e071938c845
|
||||
|
@ -34,7 +34,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "false"
|
||||
initial_ast: e620d8de925a0634dd802aa39c8f847e9de245411d15ee847ec33dd89e73eccc
|
||||
initial_ast: 094effa7fe12695679a571f560e1d3e8c299cde8de280f9309010c85f48bab95
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: e620d8de925a0634dd802aa39c8f847e9de245411d15ee847ec33dd89e73eccc
|
||||
type_inferenced_ast: b969e139ce4f0a1a1a14ae994823bc62d99621733779cc4d79784c17503822d4
|
||||
canonicalized_ast: 094effa7fe12695679a571f560e1d3e8c299cde8de280f9309010c85f48bab95
|
||||
type_inferenced_ast: ab25cb7bf7d8fe3ec64be183550ba8d6acfaf17464cf70ec45c6497fc065ac29
|
||||
|
@ -34,7 +34,7 @@ outputs:
|
||||
x:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: adaec4556aea17844bf2b676cbc7c161abdc2976d4a753838520555f7056caa6
|
||||
initial_ast: e2facdce5f7cdbed4a3215cc258e54418aac4f4b846349b35e1da67b577b76c9
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: adaec4556aea17844bf2b676cbc7c161abdc2976d4a753838520555f7056caa6
|
||||
type_inferenced_ast: c3f80efa21f5527ce703b5b58d17742db53ad1a56c05f8d9a19343d29ee711f4
|
||||
canonicalized_ast: e2facdce5f7cdbed4a3215cc258e54418aac4f4b846349b35e1da67b577b76c9
|
||||
type_inferenced_ast: fb43dcb50c9822e2d4e4f35e9cc73f0893e508161296be5666cd90c4f7a971bc
|
||||
|
@ -100,13 +100,7 @@ outputs:
|
||||
r:
|
||||
type: char
|
||||
value: "'\\u{1f62d}'"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 9b476ab0cc1f82ffbe5735bdc9839290da1f19b860193bc6ca76dac7086797a9
|
||||
initial_ast: 77a91d0bba02b2c0da0b8a455460cf0e4873a23fe07fd6c2055c881f065cdfe9
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 9b476ab0cc1f82ffbe5735bdc9839290da1f19b860193bc6ca76dac7086797a9
|
||||
type_inferenced_ast: c1b6a8e1c31fe2eb3c523e9d142093f4bd0ea426c0bb1b179ee4b3624e202102
|
||||
=======
|
||||
initial_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75
|
||||
canonicalized_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75
|
||||
type_inferenced_ast: d04164068277e88b5529f1072b512ffadc7eaaf704c8a3e394a409e783cc1e27
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 77a91d0bba02b2c0da0b8a455460cf0e4873a23fe07fd6c2055c881f065cdfe9
|
||||
type_inferenced_ast: 545343f828df02fec9995639e0c3d03464ab896475d6ca2ebd3304d237c55ec7
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370000]: '\n --> compiler-test:4:23\n |\n 4 | const not_valid = '';\n | ^"
|
||||
- "Error [EPAR0370000]: '\n --> compiler-test:4:23\n |\n 4 | const not_valid = '';\n | ^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::parser::parser_errors::ParserError>::unexpected_token<str>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_parser::tokenizer::tokenize\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\parser\\src\\tokenizer\\mod.rs:85\n 7: \u001b[0m\u001b[38;5;9mleo_parser::parser::parse\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\parser\\src\\parser\\mod.rs:50\n 8: \u001b[0m\u001b[38;5;9mleo_parser::parse_ast<str,str>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\parser\\src\\lib.rs:40\n 9: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:245\n10: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n11: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n12: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n13: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n14: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n15: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n16: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n17: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n18: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n19: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n20: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n21: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n22: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n23: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -100,7 +100,7 @@ outputs:
|
||||
r:
|
||||
type: char
|
||||
value: "'a'"
|
||||
initial_ast: d007e92eb9ec687265b31a56b8d1914d54ee7cb6fd0b09e1e3a63ed61326309c
|
||||
initial_ast: ac56e34b2a2cb282d36133df39d80947dfdfc56b5655b3ba9f408ba529c8f505
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: d007e92eb9ec687265b31a56b8d1914d54ee7cb6fd0b09e1e3a63ed61326309c
|
||||
type_inferenced_ast: b1ee742a5f862fe913041a82e0fdfe4bc62cdc6e585ab939d475fc31f8940369
|
||||
canonicalized_ast: ac56e34b2a2cb282d36133df39d80947dfdfc56b5655b3ba9f408ba529c8f505
|
||||
type_inferenced_ast: 2eecf906226893c46f526a72f272a3f11eb34ada7cc4cd573439ebfed44ba170
|
||||
|
@ -19,7 +19,7 @@ outputs:
|
||||
r1:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 354b1544d8b93fdc5dd30711f65e183ff5e2495c3618169b148f74d4cf6b775b
|
||||
initial_ast: 495d681d55225a08bd4b653d8513e6d83ecbd3b6830a5afc57d1731c8102433e
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 354b1544d8b93fdc5dd30711f65e183ff5e2495c3618169b148f74d4cf6b775b
|
||||
type_inferenced_ast: 6b9deb939b3fdaecdad3910a4b2021a6a39cf3612ea310edc4f7f072a896578e
|
||||
canonicalized_ast: 495d681d55225a08bd4b653d8513e6d83ecbd3b6830a5afc57d1731c8102433e
|
||||
type_inferenced_ast: 26de2b1a581fe9c56558a75cae3625a82b7908cfc1dc51d7396c90c321596206
|
||||
|
@ -100,7 +100,7 @@ outputs:
|
||||
r:
|
||||
type: char
|
||||
value: "'\\u{1f62d}'"
|
||||
initial_ast: d298676c7a5febbc06b5946859f33b30e04f9b6c05c129a99fc555277e28e740
|
||||
initial_ast: 6e1cf86d47e056682c6e51dcf0390eb34505b60d50de60970a688f237525bedf
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: d298676c7a5febbc06b5946859f33b30e04f9b6c05c129a99fc555277e28e740
|
||||
type_inferenced_ast: fbb7c4bc0487bc9fe9371a171a219c697ea699fc696f7aa5ccd410e7f3e9bdd9
|
||||
canonicalized_ast: 6e1cf86d47e056682c6e51dcf0390eb34505b60d50de60970a688f237525bedf
|
||||
type_inferenced_ast: feb16e72f13a884e3303b336f7f20ff8ff4066a8f9861860e28b9c6901215b76
|
||||
|
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: f07f94732bac78a34babc46bf89d52fd54e94d26a542c4ac9c8be18b4e134147
|
||||
initial_ast: 58f66e3a45b1752bb5dbb454adbbe6136394a7a87bc7b812d154aec1d5eac816
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: da80138eeba68ac6fd321c5e70a6b2c8c684164df2e7b8a567c96e5f5fae49b3
|
||||
type_inferenced_ast: 535b85a7fdf15d30b0fb862432abc822129ca90e4ab95861e76692aa2b8d1865
|
||||
=======
|
||||
initial_ast: bc330763338677f23601b03f5665bd8f42f8143f59cc9b4803fb693b3cfa0311
|
||||
canonicalized_ast: fbff610ef772ee7f997b4bc4cd7c2a3f2024d70af35b94a966ca6a0f19f15194
|
||||
type_inferenced_ast: f6b0159f6bffeff8e3cde7f13c97ac5d537b40855271a4a13d07a84d24d78504
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: f7359bbb8cecd0923c0aa7dd7fd6b01cb2c64e45f1e777709fb14d4e6ba0ee5a
|
||||
type_inferenced_ast: f3a0378b8b60f66ca164be498224592907216262a54a92d878e52f0a85f53389
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 43c77feea5d5dd8c43bf9683bcaaef76a2ad8f0c60107b8bb083ef209c8d4f25
|
||||
initial_ast: 50c0f7261d879373f4e01ec3d140a2067ca4e78622c8340e8312d717f6effb05
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 43c77feea5d5dd8c43bf9683bcaaef76a2ad8f0c60107b8bb083ef209c8d4f25
|
||||
type_inferenced_ast: 3152b144908381ea564e157067b103f10cfa0cdaad30d683ca3ad0063f32c6d4
|
||||
=======
|
||||
initial_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47
|
||||
canonicalized_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47
|
||||
type_inferenced_ast: 110a4e51c4c0ace6c0f3aa385e1735cb4ecf3cfea2a9d2ab7591da3826582c31
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 50c0f7261d879373f4e01ec3d140a2067ca4e78622c8340e8312d717f6effb05
|
||||
type_inferenced_ast: 161edd5d1900f2902bd8cc972308ce7fb0afe7c6cf64ab7cfe952c3f1b3189c0
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373032]: illegal assignment to immutable variable 'self'\n --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^"
|
||||
- "Error [EASG0373032]: illegal assignment to immutable variable 'self'\n --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::immutable_assignment<tendril::tendril::Tendril<tendril::fmt::UTF8, tendril::tendril::NonAtomic>*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::statement::assign::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\assign.rs:75\n 7: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:90\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n 9: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n10: \u001b[0m\u001b[38;5;9mleo_asg::program::circuit::Circuit::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\circuit.rs:133\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:325\n12: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n13: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n14: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n16: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n17: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n19: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n22: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n23: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n24: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n25: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n26: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n27: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 67297ef0189a61ca4642ab67d2a065cce9b1c3f991c60b38609254f3e2baaa69
|
||||
initial_ast: bfd7751e8ea64c6d41af36d968f194a18a5411ac71932a67766f40448ce755f5
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 67297ef0189a61ca4642ab67d2a065cce9b1c3f991c60b38609254f3e2baaa69
|
||||
type_inferenced_ast: 5ac0f8474890799611ef0a16a6f89e6fc673107bcad36e76909b16a932932c1e
|
||||
=======
|
||||
initial_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261
|
||||
canonicalized_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261
|
||||
type_inferenced_ast: 29604fd57ee8658f83e552bc6496541ebcebb91afa313a1706b285fe18385c4c
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: bfd7751e8ea64c6d41af36d968f194a18a5411ac71932a67766f40448ce755f5
|
||||
type_inferenced_ast: 910b51f962861da6011f214a5379bc9296034e3fecda347b17c7db97df833a25
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 56fb53b9bcf802ecf0d9b42dc5cb20bb647993862b93ef36ef4726253d2e4953
|
||||
initial_ast: d8a66347f480161a2215c92d2cf6ded2d0b49fd76b7eb0036d4fa33de371925a
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 56fb53b9bcf802ecf0d9b42dc5cb20bb647993862b93ef36ef4726253d2e4953
|
||||
type_inferenced_ast: 465b240450a196f9f1ea50ad078eb5b969991e7727089923a99829a8b1a4d090
|
||||
canonicalized_ast: d8a66347f480161a2215c92d2cf6ded2d0b49fd76b7eb0036d4fa33de371925a
|
||||
type_inferenced_ast: d5bb87130d78bb39fa948ce868999184f90c78ada176cf08c49051517de3351c
|
||||
|
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: u32
|
||||
value: "100"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: e40f94044b364e85706d791db55cafa482f8d70aa85861f823be0357821381ff
|
||||
initial_ast: c40a1d60f872fdb03ab7379a3abf43439a100b8f1546b76ffeac60c8739e0d68
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: e40f94044b364e85706d791db55cafa482f8d70aa85861f823be0357821381ff
|
||||
type_inferenced_ast: 5823efea8a487179c8a12b9a2b7987952c5ee62abf0b73fcada58ec28d06531d
|
||||
=======
|
||||
initial_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642
|
||||
canonicalized_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642
|
||||
type_inferenced_ast: 213f747571838133c62a73574f769d25fd42afce151e580be42d1d9d7b62033b
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: c40a1d60f872fdb03ab7379a3abf43439a100b8f1546b76ffeac60c8739e0d68
|
||||
type_inferenced_ast: 3d56ffd95d1b84970e24f10a48f52053717876f062db72d8be93f413f7b2c9a3
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373002]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y: 0u32 };\n | ^^^^^^^^^^^^^^^"
|
||||
- "Error [EASG0373002]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y: 0u32 };\n | ^^^^^^^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::missing_circuit_member<tendril::tendril::Tendril<tendril::fmt::UTF8, tendril::tendril::NonAtomic>*,alloc::string::String*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::circuit_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\circuit_init.rs:133\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:330\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EASG0373002]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y };\n | ^^^^^^^^^"
|
||||
- "Error [EASG0373002]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y };\n | ^^^^^^^^^\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\u001b[0m\u001b[38;5;14m ⋮ 4 frames hidden ⋮ \n\u001b[0m 5: \u001b[0m\u001b[38;5;9menum$<leo_errors::asg::asg_errors::AsgError>::missing_circuit_member<tendril::tendril::Tendril<tendril::fmt::UTF8, tendril::tendril::NonAtomic>*,alloc::string::String*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\errors\\src\\common\\macros.rs:86\n 6: \u001b[0m\u001b[38;5;9mleo_asg::expression::circuit_init::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\circuit_init.rs:133\n 7: \u001b[0m\u001b[38;5;9mleo_asg::expression::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\expression\\mod.rs:330\n 8: \u001b[0m\u001b[38;5;9mleo_asg::statement::definition::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\definition.rs:67\n 9: \u001b[0m\u001b[38;5;9mleo_asg::statement::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\mod.rs:89\n10: \u001b[0m\u001b[38;5;9mleo_asg::statement::block::{{impl}}::from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\statement\\block.rs:46\n11: \u001b[0m\u001b[38;5;9mleo_asg::program::function::Function::fill_from_ast\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\function.rs:139\n12: \u001b[0m\u001b[38;5;9mleo_asg::program::Program::new\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\program\\mod.rs:309\n13: \u001b[0m\u001b[38;5;9mleo_asg::Asg::new<leo_ast::program::Program*>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\asg\\src\\lib.rs:89\n14: \u001b[0m\u001b[38;5;9mleo_compiler::compiler::Compiler<snarkvm_fields::fp_256::Fp256<snarkvm_curves::bls12_377::fr::FrParameters>, enum$<leo_compiler::value::group::targets::edwards_bls12::EdwardsGroupType>>::parse_program_from_string<snarkvm_fields::fp_256::Fp256<snarkvm_curv\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\compiler.rs:275\n15: \u001b[0m\u001b[38;5;9mleo_compiler::test::parse_program\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:77\n16: \u001b[0m\u001b[38;5;9mleo_compiler::test::{{impl}}::run_test\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:117\n17: \u001b[0m\u001b[38;5;9mleo_test_framework::runner::run_tests<leo_compiler::test::TestRunner>\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\test-framework\\src\\runner.rs:151\n18: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:270\n19: \u001b[0m\u001b[38;5;9mleo_compiler::test::compiler_tests::{{closure}}\n\u001b[0m at C:\\Users\\jonat\\AppData\\Roaming\\work\\leo\\compiler\\src\\test.rs:269\n20: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once<closure-0,tuple<>>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n21: \u001b[0m\u001b[32mcore::ops::function::FnOnce::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\core\\src\\ops\\function.rs:227\n22: \u001b[0m\u001b[32mtest::__rust_begin_short_backtrace<fn()>\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:577\n23: \u001b[0m\u001b[32malloc::boxed::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\alloc\\src\\boxed.rs:1575\n24: \u001b[0m\u001b[32mstd::panic::{{impl}}::call_once\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:347\n25: \u001b[0m\u001b[32mstd::panicking::try::do_call\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:401\n26: \u001b[0m\u001b[32mstd::panicking::try\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panicking.rs:365\n27: \u001b[0m\u001b[32mstd::panic::catch_unwind\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\library\\std\\src\\panic.rs:434\n28: \u001b[0m\u001b[32mtest::run_test_in_process\n\u001b[0m at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\\/library\\test\\src\\lib.rs:600\n\u001b[0m\u001b[38;5;14m ⋮ 15 frames hidden ⋮ \n\u001b[0m"
|
||||
|
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 73ed50cda12e4cb9f06b4118324f9eba10383ffd79883ff9d10d04f328d18819
|
||||
initial_ast: cf642f2f983cd8bcd6cbca2d2920f5234d79375601c1da3c06f97b6185a5629d
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 314434fd2549c45af345d678e5b202c9f72a5e4219f6122d733188fd64d12c30
|
||||
type_inferenced_ast: 01f97cdd9186508c334e1546c9e700bcbd4ea103926fc8d2112ed439105dc0cf
|
||||
=======
|
||||
initial_ast: 3b07cdd6e203ad5775a6c75a4598330e4bf7b04616bdbd532df20bd7bba1981d
|
||||
canonicalized_ast: f87f269c06e5eb1d6802b4a92c9a4af2a3966583dbaa2454b5468b3f56114a15
|
||||
type_inferenced_ast: 73ed7092d40d9b7e5be744e14da191eaa7f0758b6027c7e984365bd33e07ae2d
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: f99560385252ad2965e39b19402e7c56db402458206187eeb54adc26effd9bb5
|
||||
type_inferenced_ast: c7c5cd5ed24fd3967f19a5ad895aeb7778b3dfadc7965c3f5bc1d44c61448083
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: dc9e548133ab1e7b8fdb11cabc90a5761e17cd5126c75697bd3261ee41875013
|
||||
initial_ast: 5273a592b167cfe040b2bca7337521084d7a6640651bca584545e9eeb2e4fa88
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: dc9e548133ab1e7b8fdb11cabc90a5761e17cd5126c75697bd3261ee41875013
|
||||
type_inferenced_ast: 41e3e10f22639e3a59bbfd5347bc55d9f8d08a7457697dadcf58fe168d1e52a9
|
||||
=======
|
||||
initial_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089
|
||||
canonicalized_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089
|
||||
type_inferenced_ast: a94dfe431aa43189323427aadb33120d4ac03e19b9a898353858c26b624869ed
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 5273a592b167cfe040b2bca7337521084d7a6640651bca584545e9eeb2e4fa88
|
||||
type_inferenced_ast: 6d1bef6ecbba4533266f9478b06e52acc56f04850e99a658abffe39e7e463cdf
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 7f98f34694dff74fb29f362ffcf6a1c4e6ee13d3b2dbc20f04c375135491bab2
|
||||
initial_ast: 241f1a42877b012b2e2062cefbd83523a5c719557cb422cf1fbd7efb0f7b1796
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 7f98f34694dff74fb29f362ffcf6a1c4e6ee13d3b2dbc20f04c375135491bab2
|
||||
type_inferenced_ast: 9e9df4ff40f29b9261e46ad45fd159d3c135c0037a8f72a2b927321dae0005ad
|
||||
=======
|
||||
initial_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5
|
||||
canonicalized_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5
|
||||
type_inferenced_ast: 14d9f0f0a222b6ec4236b0eb75e0740d624279181bb7ab9281752529b0a0f417
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 241f1a42877b012b2e2062cefbd83523a5c719557cb422cf1fbd7efb0f7b1796
|
||||
type_inferenced_ast: 2982ee6fda2fcbd00f64d2c0c75ccacf58ab05961f85e9a64cc0ddec12bb5209
|
||||
|
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 03e8152d42ce6b826a96a7bd22a94667f2afc573d91b1caf2d2aa208cd1d06d0
|
||||
initial_ast: 11dfbfa2561534a1c965d8f8862b23ed56be50986903c139b763f88a1ba3ad8d
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 03e8152d42ce6b826a96a7bd22a94667f2afc573d91b1caf2d2aa208cd1d06d0
|
||||
type_inferenced_ast: d73a2a3ded712d961b298bf08909c71e49ef010d806e27ab0eefd4fd53a3a863
|
||||
canonicalized_ast: 11dfbfa2561534a1c965d8f8862b23ed56be50986903c139b763f88a1ba3ad8d
|
||||
type_inferenced_ast: 6aab6f0cf6a9237ec02b5ce3f4ad8f24c8faa8ec5ccbc7f3af1023d0269dceea
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 3100a81f902dd1b37f89f9e4024dc80d326dd7194540a6660b961c4bac300808
|
||||
initial_ast: 42f603efbf7ee8ca53394266f33fbf09110420c822385179d656861e8ceb4a32
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 1a4d0222119b6868c51a966a23e7f9830c51d2d7e7cf4c8d203a08511f4c6e27
|
||||
type_inferenced_ast: 3b80d193f84ccf19f91d3373fa08800ac6402b91563b317d025311204400aa70
|
||||
canonicalized_ast: 92d91209d7675fc14ae1fd44c28d1384f1c56c5852654b4dac46dd123340d9c0
|
||||
type_inferenced_ast: 0527005fb0925ac29af65bb0c12c39991d466c20def41ce7e4a2ded51ae233fc
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: 0ac9bb4bd1f8a0415729a64e2139a66e747f4115d10d17a319d78aef7532f062
|
||||
initial_ast: cf41b78f9435c6555014db8aeebe662556f4f8547ee0f3a204d6f522fcf72644
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: 0ac9bb4bd1f8a0415729a64e2139a66e747f4115d10d17a319d78aef7532f062
|
||||
type_inferenced_ast: 1afd585064d117e92b84c7aee2c7a20403b9acb126c256fc627d27810715f0f1
|
||||
=======
|
||||
initial_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127
|
||||
canonicalized_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127
|
||||
type_inferenced_ast: db8685abd4ffc32fa55786b847eff1d0694b871c1757eec70757879d82856872
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: cf41b78f9435c6555014db8aeebe662556f4f8547ee0f3a204d6f522fcf72644
|
||||
type_inferenced_ast: d947fa6d8fa1b34cc9822ade386062dbd6ebc2cb5987479d4263bcfa554586cd
|
||||
|
@ -16,13 +16,7 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
<<<<<<< HEAD
|
||||
initial_ast: e5f0db833c0c7b531575f2d8ffc5174ab383de5e3a0b37e53c700d5b7ce4a4f3
|
||||
initial_ast: 622baae85ab7776fc38cff17465e8e0dbcdb98f4ba74e734ca494b696cea8ccd
|
||||
imports_resolved_ast: 4ca172d902f797a1d225223900fbf3f01a68c44ad5a0cf402e719f9e5961988b
|
||||
canonicalized_ast: e5f0db833c0c7b531575f2d8ffc5174ab383de5e3a0b37e53c700d5b7ce4a4f3
|
||||
type_inferenced_ast: 4c771c6cd61a2b7acdf63f7ecd0d8c129f843a67895b28cf5462c771bcade692
|
||||
=======
|
||||
initial_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6
|
||||
canonicalized_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6
|
||||
type_inferenced_ast: ec5aad932c3d0d016142a7d288328547949da8add55025076c5d404d2451917d
|
||||
>>>>>>> 7a5979660b7c4200fc3c8feb3263dbadd04daf0a
|
||||
canonicalized_ast: 622baae85ab7776fc38cff17465e8e0dbcdb98f4ba74e734ca494b696cea8ccd
|
||||
type_inferenced_ast: c604cecb0efbae6b8ea3d69909c5decbb06d6a2e95ff67661f5936ef8fd951a5
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user