Skip to content

Commit

Permalink
Show error message on the compiler's ascii graphic too
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-shigueo committed Nov 11, 2024
1 parent 4d1a6d4 commit 0d51986
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ts-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ impl Dependency {
#[diagnostic::on_unimplemented(
message = "`#[ts(optional)]` can only be used on fields of type `Option`",
note = "`#[ts(optional)]` was used on a field of type {Self}, which is not permitted",
label = ""
label = "`#[ts(optional)]` is not allowed on field of type {Self}"
)]
pub trait IsOption {}

Expand Down
1 change: 1 addition & 0 deletions ts-rs/tests/integration/optional_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct OptionalStruct {
#[ts(optional = nullable)]
c: Option<i32>,

#[ts(optional)]
d: i32,

e: Foo,
Expand Down

0 comments on commit 0d51986

Please sign in to comment.