fixes for issues #185 and #181

This commit is contained in:
Mark Thom
2019-10-04 20:03:03 -06:00
parent 1569cac98f
commit 3fa168d35b
6 changed files with 22 additions and 15 deletions

View File

@@ -280,6 +280,15 @@ pub fn fetch_op_spec(
spec: Option<SharedOpDesc>,
op_dir: &OpDir,
) -> Option<SharedOpDesc> {
if let Some(ref op_desc) = &spec {
if op_desc.arity() != arity {
/* it's possible to extend operator functors with
* additional terms. When that happens,
* void the op_spec by returning None. */
return None;
}
}
spec.or_else(|| match arity {
2 => op_dir
.get(&(name, Fixity::In))