use super::ComparatorKind;
#[inline]
pub fn validate_comparator_for_type(
kind: &ComparatorKind,
output_type: &crate::spec::types::DataType,
op_id: &str,
) {
match output_type {
crate::spec::types::DataType::U32
| crate::spec::types::DataType::I32
| crate::spec::types::DataType::U64
| crate::spec::types::DataType::Vec2U32
| crate::spec::types::DataType::Vec4U32
| crate::spec::types::DataType::Bytes => {
assert!(
matches!(
kind,
ComparatorKind::ExactMatch | ComparatorKind::UnorderedMatch
),
"Fix: op '{}' has integer/byte output type {:?} but uses {:?} comparator. \
Integer ops MUST use ExactMatch or UnorderedMatch. \
Approximate is only valid for future float ops.",
op_id,
output_type,
kind
);
}
_ => {} }
}