Skip to content

Fix bad failure references in builtins #2033

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

Merged
merged 2 commits into from
May 28, 2021
Merged

Fix bad failure references in builtins #2033

merged 2 commits into from
May 28, 2021

Conversation

dolio
Copy link
Contributor

@dolio dolio commented May 27, 2021

  • When originally written, various builtins were referencing data types
    defined in IOSource. However, those no longer exist there.
  • Instead, they are defined in Unison.Builtin.Decls
  • This switches the builtins to the Decls values, some of which weren't
    exported yet.
  • Also eliminates them from IOSource, since the ones there didn't
    actually work.
  • Transcript testing the behavior added.

Fixes #2027, inasmuch as it now gives a proper failure condition.

- When originally written, various builtins were referencing data types
  defined in IOSource. However, those no longer exist there.
- Instead, they are defined in Unison.Builtin.Decls
- This switches the builtins to the Decls values, some of which weren't
  exported yet.
- Also eliminates them from IOSource, since the ones there didn't
  actually work.
- Transcript testing the behavior added.
@pchiusano pchiusano added the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label May 27, 2021
@dolio
Copy link
Contributor Author

dolio commented May 27, 2021

Hmm, the exact error message depends on OS, and that ends up in the transcript output.

@pchiusano
Copy link
Member

@dolio you can match on the failure and just strip out the message

match f with Failure typ msg any -> Failure typ "oh noe!" any

@pchiusano
Copy link
Member

Looks great, mergin'!

@pchiusano pchiusano merged commit f992576 into trunk May 28, 2021
@pchiusano pchiusano deleted the fix/2027 branch May 28, 2021 02:02
@pchiusano pchiusano mentioned this pull request Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ucm exits with "No builtin type called: io2.Failure" when calling new IO functions
2 participants