Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offer! macro does not catch too-small arity #115

Open
plaidfinch opened this issue Jun 8, 2021 · 0 comments · May be fixed by #98
Open

offer! macro does not catch too-small arity #115

plaidfinch opened this issue Jun 8, 2021 · 0 comments · May be fixed by #98
Assignees
Labels
bug Something isn't working

Comments

@plaidfinch
Copy link
Contributor

This compiles, but it shouldn't:

use dialectic::prelude::*;

type S = Session! {
    offer {
        0 => {}
    }
};

#[Transmitter(Tx)]
#[Receiver(Rx)]
async fn run<Tx, Rx, E>(chan: Chan<S, Tx, Rx>) -> Result<(), E>
where
    E: From<Tx::Error> + From<Rx::Error>,
{
    offer!(in chan {
        // no branches!!!
    })?
}

The current offer! macro (not on the carrier-type branch) does not catch this error, and indeed can't catch this error in the macro itself. This bug increases the urgency with which I would like to merge the carrier-type branch, because the offer! macro which integrates Vesta should catch this bug.

@plaidfinch plaidfinch added the bug Something isn't working label Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants