nac3artiq: throw error message when constructor use rpc decorator #306

Merged
sb10q merged 10 commits from issue-221 into master 2022-07-11 15:55:55 +08:00
1 changed files with 1 additions and 0 deletions
Showing only changes of commit 74d39be59c - Show all commits

View File

@ -402,6 +402,7 @@ impl Nac3 {
} }
}) })
{ {
// This part check if __init__ method decorate with inappropriate decorator (rpc)
if name == &"__init__".into() { if name == &"__init__".into() {
return Err(CompileError::new_err(format!( return Err(CompileError::new_err(format!(
"compilation failed\n----------\nConstructor __init__ function should not decorated with rpc decorator (at {})", "compilation failed\n----------\nConstructor __init__ function should not decorated with rpc decorator (at {})",