From 375ef3381e629f49c8c2378489f10a702cedb01d Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Thu, 28 Sep 2023 11:26:25 +0100 Subject: [PATCH] Rename {CachedType=>TypeApplyCache}Incorrect, drop comment about #508 --- src/extension.rs | 11 ++++------- src/ops/leaf.rs | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/extension.rs b/src/extension.rs index e0df9e66e..2cc925fcf 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -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 - /// ). + /// [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, }, } diff --git a/src/ops/leaf.rs b/src/ops/leaf.rs index 957afbd5b..528b81366 100644 --- a/src/ops/leaf.rs +++ b/src/ops/leaf.rs @@ -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(), }) }