Skip to content

Commit

Permalink
fix: fix usage of `#[abi(tag)] attribute with elaborator
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 20, 2024
1 parent 4c4ea2d commit cf7fb09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ impl<'context> Elaborator<'context> {
self.current_item = Some(DependencyId::Global(global_id));
let let_stmt = global.stmt_def;

if !self.in_contract
if !self.module_id().module(self.def_maps).is_contract
&& let_stmt.attributes.iter().any(|attr| matches!(attr, SecondaryAttribute::Abi(_)))
{
let span = let_stmt.pattern.span();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "abi_attribute"
type = "contract"
authors = [""]

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contract Foo {
#[abi(foo)]
global foo: Field = 42;
}

0 comments on commit cf7fb09

Please sign in to comment.