Skip to content

fix(napi-derive): tuple object and enum#2227

Merged
Brooooooklyn merged 2 commits intonapi-rs:mainfrom
CPunisher:fix/tuple-struct
Aug 23, 2024
Merged

fix(napi-derive): tuple object and enum#2227
Brooooooklyn merged 2 commits intonapi-rs:mainfrom
CPunisher:fix/tuple-struct

Conversation

@CPunisher
Copy link
Contributor

Currently tuple object is broken. For example:

#[napi(object)]
pub struct B(pub u32);

The expanded code contains:

let Self(arg 0) = val; // unexpected whitespace

According to the docs https://docs.rs/quote/latest/quote/macro.quote.html#constructing-identifiers, concatenating two tokens will continue to be two separate tokens.

There is also weird arg#1 in the code. Could it be a typo?

@Brooooooklyn Brooooooklyn merged commit 249c27e into napi-rs:main Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants