use std::hash::Hasher;
use crate::types::{Ident, TypeEq, Types};
#[derive(Default, Debug, Clone)]
pub struct DynamicInfo {
pub type_: Option<Ident>,
pub derived_types: Vec<Ident>,
}
impl TypeEq for DynamicInfo {
fn type_hash<H: Hasher>(&self, hasher: &mut H, types: &Types) {
let Self {
type_,
derived_types,
} = self;
type_.type_hash(hasher, types);
TypeEq::type_hash_slice(derived_types, hasher, types);
}
fn type_eq(&self, other: &Self, types: &Types) -> bool {
let Self {
type_,
derived_types,
} = self;
type_.type_eq(&other.type_, types)
&& TypeEq::type_eq_iter(derived_types.iter(), other.derived_types.iter(), types)
}
}