Skip to content

Commit

Permalink
Rename {CachedType=>TypeApplyCache}Incorrect, drop comment about #508
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Sep 28, 2023
1 parent 600d548 commit 375ef33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,12 @@ pub enum SignatureError {
#[error("Type variable {idx} was not declared ({num_decls} in scope)")]
FreeTypeVar { idx: usize, num_decls: usize },
/// The type stored in a [LeafOp::TypeApply] is not what we compute from the
/// [ExtensionRegistry]. (Note: might be commoned up with
/// [CustomOpError::SignatureMismatch] if we implement
/// <https://github.com/CQCL-DEV/hugr/issues/508>).
/// [ExtensionRegistry].
///
/// [LeafOp::TypeApply]: crate::ops::LeafOp::TypeApply
/// [CustomOpError::SignatureMismatch]: crate::ops::custom::CustomOpError::SignatureMismatch
#[error("Incorrect cache of signature - found {stored} but expected {expected}")]
CachedTypeIncorrect {
stored: PolyFuncType,
#[error("Incorrect result of type application - cached {cached} but expected {expected}")]
TypeApplyIncorrectCache {
cached: PolyFuncType,
expected: PolyFuncType,
},
}
Expand Down
4 changes: 2 additions & 2 deletions src/ops/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ impl TypeApplication {
if other.output == self.output {
Ok(())
} else {
Err(SignatureError::CachedTypeIncorrect {
stored: self.output.clone(),
Err(SignatureError::TypeApplyIncorrectCache {
cached: self.output.clone(),
expected: other.output.clone(),
})
}
Expand Down

0 comments on commit 375ef33

Please sign in to comment.