We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
#[export]
Gd<T>
DynGd<T, D>
1 parent 47cc8da commit 0366b05Copy full SHA for 0366b05
godot-macros/src/class/derive_godot_class.rs
@@ -680,6 +680,14 @@ fn parse_fields(
680
if let Some(mut parser) = KvParser::parse(&named_field.attributes, "export")? {
681
let export = FieldExport::new_from_kv(&mut parser)?;
682
field.export = Some(export);
683
+
684
+ if path_ends_with_complex(&field.ty, "Gd") || path_ends_with_complex(&field.ty, "DynGd")
685
+ {
686
+ return bail!(
687
+ field.ty,
688
+ "`Gd` and `DynGd` cannot be used directly as properties because they are non-nullable. Use `OnEditor<T>` or `Option<T>` instead."
689
+ );
690
+ }
691
parser.finish()?;
692
}
693
0 commit comments