fix type assertion error

This commit is contained in:
collin 2020-10-28 09:53:27 -07:00
parent cb3ad47f4f
commit 833eb51c68
2 changed files with 4 additions and 4 deletions

View File

@ -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,
));
}

View File

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