flux icon indicating copy to clipboard operation
flux copied to clipboard

Remove return type from variant specification

Open ranjitjhala opened this issue 6 months ago • 2 comments

The only reason we need to check this is that we allow you to write the "return type" for a variant. If we instead had:

#[flux::refined_by(b: bool)]
enum Option<T> {
    #[flux::variant([false])]
    None,
    #[flux::variant((T) -> [true])]
    Some(T)
}

then, this wouldn't cause any problems. Not in this PR, but we should consider changing the syntax.

Originally posted by @nilehmann in https://github.com/flux-rs/flux/pull/586#discussion_r1437115186

ranjitjhala avatar Dec 27 '23 19:12 ranjitjhala