Remove unused record destructuring tests
These tests were for record destructuring, which has been removed. The code for record destructuring was also removed from the type checker and types modules.
This commit is contained in:
+1
-12
@@ -299,16 +299,6 @@ impl StaticType {
|
||||
.zip(other_elements.iter())
|
||||
.all(|(e, o)| e.is_assignable_from(o))
|
||||
}
|
||||
// Record to Tuple (Destructuring by values)
|
||||
(StaticType::Tuple(elements), StaticType::Record(fields)) => {
|
||||
if elements.len() != fields.len() {
|
||||
return false;
|
||||
}
|
||||
elements
|
||||
.iter()
|
||||
.zip(fields.iter().map(|(_, ty)| ty))
|
||||
.all(|(e, o)| e.is_assignable_from(o))
|
||||
}
|
||||
// A Matrix is a Vector (of Vectors/Matrices)
|
||||
(StaticType::Vector(inner, len), StaticType::Matrix(m_inner, shape)) => {
|
||||
if shape.is_empty() || shape[0] != *len {
|
||||
@@ -367,11 +357,10 @@ impl Value {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the underlying values as a slice if this is a Tuple or Record.
|
||||
/// Returns the underlying values as a slice if this is a Tuple.
|
||||
pub fn as_slice(&self) -> Option<&[Value]> {
|
||||
match self {
|
||||
Value::Tuple(v) => Some(v),
|
||||
Value::Record(r) => Some(&r.values),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user