cairo_lang_sierra/extensions/modules/
squashed_felt252_dict.rs1use crate::extensions::SpecializationError;
2use crate::extensions::type_specialization_context::TypeSpecializationContext;
3use crate::extensions::types::{
4 GenericTypeArgGenericType, GenericTypeArgGenericTypeWrapper, TypeInfo,
5};
6use crate::ids::GenericTypeId;
7
8#[derive(Default)]
10pub struct SquashedFelt252DictTypeWrapped {}
11impl GenericTypeArgGenericType for SquashedFelt252DictTypeWrapped {
12 const ID: GenericTypeId = GenericTypeId::new_inline("SquashedFelt252Dict");
13
14 fn calc_info(
15 &self,
16 _context: &dyn TypeSpecializationContext,
17 long_id: crate::program::ConcreteTypeLongId,
18 TypeInfo { zero_sized, storable, droppable, .. }: TypeInfo,
19 ) -> Result<TypeInfo, SpecializationError> {
20 if storable && !zero_sized {
25 Ok(TypeInfo {
26 long_id,
27 storable: true,
28 droppable,
29 duplicatable: false,
30 zero_sized: false,
31 })
32 } else {
33 Err(SpecializationError::UnsupportedGenericArg)
34 }
35 }
36}
37pub type SquashedFelt252DictType = GenericTypeArgGenericTypeWrapper<SquashedFelt252DictTypeWrapped>;