Skip to content

Commit

Permalink
Make #[ts(type)] and #[ts(optional)] incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-shigueo committed Dec 2, 2024
1 parent 53941b5 commit 3d0a048
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions macros/src/attr/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3d0a048

Please sign in to comment.