Skip to content

Commit

Permalink
Merge pull request #1032 from godot-rust/bugfix/signal-nobody
Browse files Browse the repository at this point in the history
`#[signal]`: validate that there is no function body
  • Loading branch information
Bromeon authored Feb 1, 2025
2 parents cb4b6c1 + bf55611 commit 2f4320f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion godot-macros/src/class/data_models/inherent_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,16 @@ fn process_godot_fns(
);
}
if function.return_ty.is_some() {
return attr.bail("return types in #[signal] are not supported", function);
return bail!(
&function.return_ty,
"return types in #[signal] are not supported"
);
}
if function.body.is_some() {
return bail!(
&function.body,
"#[signal] must not have a body; declare the function with a semicolon"
);
}

let external_attributes = function.attributes.clone();
Expand Down

0 comments on commit 2f4320f

Please sign in to comment.