You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
johanpel
changed the title
A Rust vector with enum elements should result in a TypeScript array of enum elements of any elements
A Rust vector with enum elements should result in a TypeScript array of enum elements instead of any elements
Apr 14, 2025
Uh oh!
There was an error while loading. Please reload this page.
Motivation
From this Rust program:
the following TS code is generated:
Proposed Solution
The binding code is functional, but for the sake of improved type-safety on the TypeScript side it would be nice if:
foo
would returnMyEnum[]
instead ofany[]
bar
would takeMyEnum[]
instead ofany[]
for thevalues
argument.Note that the return value of
bar
is indeedMyEnum
already.Alternatives
I can't think of any other sensible alternatives to what is proposed.
Additional Context
None.
The text was updated successfully, but these errors were encountered: