1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use derivative::Derivative;
use sway_types::{Ident, Span};
use crate::{declaration_engine::DeclarationId, language::parsed, transform, type_system::*};
#[derive(Clone, Debug, Derivative)]
#[derivative(PartialEq, Eq)]
pub struct TyAbiDeclaration {
pub name: Ident,
pub interface_surface: Vec<DeclarationId>,
#[derivative(PartialEq = "ignore")]
#[derivative(Eq(bound = ""))]
pub(crate) methods: Vec<parsed::FunctionDeclaration>,
#[derivative(PartialEq = "ignore")]
#[derivative(Eq(bound = ""))]
pub(crate) span: Span,
pub attributes: transform::AttributesMap,
}
impl CreateTypeId for TyAbiDeclaration {
fn create_type_id(&self) -> TypeId {
let ty = TypeInfo::ContractCaller {
abi_name: AbiName::Known(self.name.clone().into()),
address: None,
};
insert_type(ty)
}
}