linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Implement Witty traits for `PhantomData`

Open jvff opened this issue 1 year ago • 1 comments

Motivation

In some cases it might be easier to map a PhantomData 3field inside a trait that derives some of the Witty traits to a tuple<> unit type in the generated WIT snippet.

Proposal

Implement WitType, WitLoad and WitStore for the PhantomData<T> type, mapping it to the zero-sized unit type (tuple<>).

jvff avatar Apr 09 '24 00:04 jvff

You made a good argument that it's always better to #[witty(skip)] anyway, and not have something like a _phantom: tuple<> field. So maybe it's actually better to not implement these for PhantomData?

afck avatar Apr 09 '24 09:04 afck

Closing based on the discussion to use #[witty(skip)] instead.

jvff avatar Jul 12 '24 02:07 jvff