From 3d0a0487ce4c906b53b72e91787a46383045348a Mon Sep 17 00:00:00 2001 From: gustavo-shigueo Date: Mon, 2 Dec 2024 08:56:07 -0300 Subject: [PATCH] Make #[ts(type)] and #[ts(optional)] incompatible --- macros/src/attr/field.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/macros/src/attr/field.rs b/macros/src/attr/field.rs index 8994bd66..441ae4ad 100644 --- a/macros/src/attr/field.rs +++ b/macros/src/attr/field.rs @@ -97,6 +97,13 @@ impl Attr for FieldAttr { "`type` is not compatible with `flatten`" ); } + + if let Optional::Optional { .. } = self.optional { + syn_err_spanned!( + field; + "`type` is not compatible with `optional`" + ); + } } if self.flatten {