Skip to content

Commit e85f29a

Browse files
committed
correctly pass fn attributes
1 parent f1d7471 commit e85f29a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,14 +903,25 @@ fn handle_impl_contract(
903903
// Convert the methods to ABI interface
904904
let mut interface_surface = Vec::new();
905905
for item in &item_impl.contents.inner {
906+
let (_, attributes) = attr_decls_to_attributes(
907+
&item.attributes,
908+
|attr| {
909+
attr.can_annotate_impl_item(
910+
&item.value,
911+
sway_ast::ImplItemParent::Contract,
912+
)
913+
},
914+
item.value.friendly_name(sway_ast::ImplItemParent::Contract),
915+
);
916+
906917
match &item.value {
907918
sway_ast::ItemImplItem::Fn(fn_item) => {
908919
let fn_decl = fn_signature_to_trait_fn(
909920
context,
910921
handler,
911922
engines,
912923
fn_item.fn_signature.clone(),
913-
Attributes::default(),
924+
attributes,
914925
)?;
915926

916927
// Validate parameters for mutability

0 commit comments

Comments
 (0)