Skip to content

Commit

Permalink
Fix unhelpful error found when there is an unimplemented feature. (#700)
Browse files Browse the repository at this point in the history
* Don't report type mismatch if one of the types is error recovery.

* Turn silent mode back on.
  • Loading branch information
emilyaherbert authored Jan 25, 2022
1 parent 0e86434 commit 258e926
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sway-core/src/type_engine/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,16 @@ impl Engine {
// }

// If no previous attempts to unify were successful, raise an error
(_, _) => Err(TypeError::MismatchedType {
expected,
received,
help_text: Default::default(),
span: span.clone(),
}),
(the_received, the_expected) => match (the_received, the_expected) {
(TypeInfo::ErrorRecovery, _) => Ok(vec![]),
(_, TypeInfo::ErrorRecovery) => Ok(vec![]),
_ => Err(TypeError::MismatchedType {
expected,
received,
help_text: Default::default(),
span: span.clone(),
}),
},
}
}

Expand Down

0 comments on commit 258e926

Please sign in to comment.