cairo_lang_sierra/extensions/modules/
squashed_felt252_dict.rsuse crate::extensions::type_specialization_context::TypeSpecializationContext;
use crate::extensions::types::{
GenericTypeArgGenericType, GenericTypeArgGenericTypeWrapper, TypeInfo,
};
use crate::extensions::SpecializationError;
use crate::ids::GenericTypeId;
#[derive(Default)]
pub struct SquashedFelt252DictTypeWrapped {}
impl GenericTypeArgGenericType for SquashedFelt252DictTypeWrapped {
const ID: GenericTypeId = GenericTypeId::new_inline("SquashedFelt252Dict");
fn calc_info(
&self,
_context: &dyn TypeSpecializationContext,
long_id: crate::program::ConcreteTypeLongId,
TypeInfo { zero_sized, storable, droppable, .. }: TypeInfo,
) -> Result<TypeInfo, SpecializationError> {
if storable && !zero_sized {
Ok(TypeInfo {
long_id,
storable: true,
droppable,
duplicatable: false,
zero_sized: false,
})
} else {
Err(SpecializationError::UnsupportedGenericArg)
}
}
}
pub type SquashedFelt252DictType = GenericTypeArgGenericTypeWrapper<SquashedFelt252DictTypeWrapped>;