Skip to content

Commit

Permalink
#[signal]: validate that there is no function body
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jan 24, 2025
1 parent bf4ddd9 commit e614576
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 e614576

Please sign in to comment.