diff --git a/gdnative-derive/src/native_script.rs b/gdnative-derive/src/native_script.rs index 2c90846a4..2489599ee 100644 --- a/gdnative-derive/src/native_script.rs +++ b/gdnative-derive/src/native_script.rs @@ -440,4 +440,22 @@ mod tests { let input: DeriveInput = syn::parse2(input).unwrap(); parse_derive_input(&input).unwrap(); } + + #[test] + fn derive_property_require_to_be_used_on_property_without_default_accessor() { + let input: TokenStream2 = syn::parse_str( + r#" + #[inherit(Node)] + struct Foo { + #[property(get = "Self::get_bar", set = "Self::set_bar")] + bar: i64, + }"#, + ) + .unwrap(); + let input: DeriveInput = syn::parse2(input).unwrap(); + assert_eq!( + derive_native_class(&input).unwrap_err().to_string(), + "The `property` attribute can only be used on `Property` if none of the default logic is used.".to_string(), + ); + } }