mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-26 19:51:52 +03:00
fix type assertion error
This commit is contained in:
parent
cb3ad47f4f
commit
833eb51c68
@ -118,8 +118,8 @@ impl TypeVariablePairs {
|
||||
// If the dimensions do not match, then throw an error.
|
||||
if left_dimensions_flat.ne(&right_dimensions_flat) {
|
||||
return Err(TypeAssertionError::array_dimensions(
|
||||
left_dimensions_flat,
|
||||
right_dimensions_flat,
|
||||
&left_dimensions_flat,
|
||||
&right_dimensions_flat,
|
||||
span,
|
||||
));
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ use crate::TypeMembership;
|
||||
use leo_static_check::Type;
|
||||
use leo_typed::{Error as FormattedError, Span};
|
||||
|
||||
use std::{borrow::Cow, path::Path};
|
||||
use std::path::Path;
|
||||
|
||||
/// Errors encountered when attempting to solve a type assertion.
|
||||
#[derive(Debug, Error)]
|
||||
@ -78,7 +78,7 @@ impl TypeAssertionError {
|
||||
///
|
||||
/// Mismatched array type dimensions.
|
||||
///
|
||||
pub fn array_dimensions(dimensions1: Cow<[usize]>, dimensions2: Cow<[usize]>, span: &Span) -> Self {
|
||||
pub fn array_dimensions(dimensions1: &[usize], dimensions2: &[usize], span: &Span) -> Self {
|
||||
let message = format!(
|
||||
"Expected array with dimensions `{:?}`, found array with dimensions `{:?}`.",
|
||||
dimensions1, dimensions2
|
||||
|
Loading…
Reference in New Issue
Block a user