pub fn required_size(&self, scope: &ScopeStack) -> MemSize {
        match *self {
            ItemType::Unit => MemSize::default(),
            ItemType::Primitive(size) => size,
            ItemType::Struct { .. } => MemSize::default(), //TODO: Update this when fields are supported
            ItemType::Array {item: Some(item), size: Some(size)} => {
                scope.get_type(item).required_size(scope) * size
            },
            ItemType::Function { .. } => MemSize::default(),
            _ => unreachable!(),
        }
    }
/// Computes the required size in cells of an *instance* of this type
Computes the required size in cells of an *instance* of this type
Computes the required size in cells of an * instance * of this type
pub fn required_size(&self, scope: &ScopeStack) -> MemSize {
        match *self {
            ItemType::Unit => MemSize::default(),
            ItemType::Primitive(size) => size,
            ItemType::Struct { .. } => MemSize::default(), //TODO: Update this when fields are supported
            ItemType::Array {item: Some(item), size: Some(size)} => {
                scope.get_type(item).required_size(scope) * size
            },
            ItemType::Function { .. } => MemSize::default(),
            _ => unreachable!(),
        }
    }
pub fn required_size ( & self , scope : & ScopeStack ) -> MemSize { match * self { ItemType :: Unit => MemSize :: default ( ) , ItemType :: Primitive ( size ) => size , ItemType :: Struct { .. } => MemSize :: default ( ) , //TODO: Update this when fields are supported ItemType :: Array { item : Some ( item ) , size : Some ( size ) } => { scope . get_type ( item ) . required_size ( scope ) * size } , ItemType :: Function { .. } => MemSize :: default ( ) , _ => unreachable ! ( ) , } }
Computes the required size in cells of an *instance* of this type
Computes the required size in cells of an * instance * of this type
&self
scope
&ScopeStack
&self
scope
&ScopeStack