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

Try lifting Session<Action = _> bounds into impl for better errors #110

Closed
plaidfinch opened this issue May 19, 2021 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@plaidfinch
Copy link
Contributor

Currently, the Action for methods on Chans is restricted in the where-clause of the methods themselves. This means that errors involving session type mismatches restate the full session type of the expected session in a way that can be hard to parse. It's possible that moving this bound upward to the enclosing impl block for each method would cause these errors to be easier to read. This change will require each method to be enclosed in its own impl block.

Upsides:

  • better error messages?

Downsides:

  • documentation will become more verbose, because there will be more separate impl blocks
  • potentially it won't actually improve error messages?
@plaidfinch plaidfinch added the enhancement New feature or request label May 19, 2021
@yaymukund
Copy link
Contributor

I do not think this is better 🥲

Before After
screenshot-2021-05-21-16-05-44 screenshot-2021-05-21-16-05-09

I've pushed my work to https://github.com/boltlabs-inc/dialectic/compare/better-error-experiment in case you wanna doublecheck.

@plaidfinch
Copy link
Contributor Author

Following up on this since we talked about it verbally: I agree with you, sadly. Thanks for trying it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants