Skip to content

Commit

Permalink
feat: error when hiding lifecycle methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ozwaldorf committed Aug 28, 2022
1 parent afa5eb5 commit ea80ab8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ic-kit-macros/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ pub fn gen_entry_point_code(
));
}

if entry_point.is_lifecycle() && attrs.hidden.is_some() {
return Err(Error::new(
Span::call_site(),
format!("#[{}] function cannot be hidden.", entry_point),
));
}

if entry_point.is_inspect_message() && return_length != 1 {
return Err(Error::new(
Span::call_site(),
Expand Down

0 comments on commit ea80ab8

Please sign in to comment.