Skip to content

feat(either_of): Add Either! convenience macro#4627

Open
DanikVitek wants to merge 2 commits intoleptos-rs:mainfrom
DanikVitek:either_of/Either
Open

feat(either_of): Add Either! convenience macro#4627
DanikVitek wants to merge 2 commits intoleptos-rs:mainfrom
DanikVitek:either_of/Either

Conversation

@DanikVitek
Copy link
Copy Markdown
Contributor

@DanikVitek DanikVitek commented Mar 9, 2026

This PR adds a convenience Either! macro for referring to different EitherOf{N} types.

let a: Either!(A, B, C) = todo!();
let _: EitherOf3<A, B, C> = a;

Specifying a single type parameter just aliases it:

let a: Either!(&str);
let _: &str = a;

Note

TODO: Add an empty branch that aliases the ! (never) type when it gets stabilized,
or possibly add a nightly-only (e.g. nightly_never_type) feature that does this.

@DanikVitek DanikVitek marked this pull request as draft March 9, 2026 11:46
@DanikVitek DanikVitek marked this pull request as ready for review March 9, 2026 12:08
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.

1 participant