Skip to content

Commit

Permalink
Add const attributes to TyProgram (FuelLabs#3033)
Browse files Browse the repository at this point in the history
  • Loading branch information
eureka-cpu authored Oct 14, 2022
1 parent e7674f7 commit 185a0a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sway-core/src/language/ty/declaration/constant.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
use sway_types::Ident;

use crate::language::{ty::*, Visibility};
use crate::{
language::{ty::*, Visibility},
AttributesMap,
};

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TyConstantDeclaration {
pub name: Ident,
pub value: TyExpression,
pub(crate) visibility: Visibility,
pub attributes: AttributesMap,
}
2 changes: 2 additions & 0 deletions sway-core/src/semantic_analysis/ast_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ impl ty::TyAstNode {
type_ascription,
value,
visibility,
attributes,
..
}) => {
let result =
Expand All @@ -232,6 +233,7 @@ impl ty::TyAstNode {
name: name.clone(),
value,
visibility,
attributes,
};
let typed_const_decl =
ty::TyDeclaration::ConstantDeclaration(de_insert_constant(decl));
Expand Down

0 comments on commit 185a0a7

Please sign in to comment.