Skip to content

Commit

Permalink
Set fallible to true unless array + mismatched kinds
Browse files Browse the repository at this point in the history
Signed-off-by: Luc Perkins <luc@timber.io>
  • Loading branch information
Luc Perkins committed Feb 4, 2021
1 parent 222a532 commit 0d146e7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/remap-lang/src/type_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,10 @@ impl TypeDef {
/// set `Kind::Integer | Kind::Boolean`; and so on.
pub fn fallible_unless_array_has_inner_type(mut self, kind: impl Into<value::Kind>) -> Self {
match &self.inner_type_def {
Some(InnerTypeDef::Array(inner_kind)) if kind.into() != inner_kind.kind => {
Some(InnerTypeDef::Array(inner_kind)) if kind.into() == inner_kind.kind => (),
_ => {
self.fallible = true;
}
Some(InnerTypeDef::Map(_)) => {
self.fallible = true;
}
None => {
self.fallible = true;
}
_ => (),
}

self
Expand Down

0 comments on commit 0d146e7

Please sign in to comment.