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
functoria: Constraint the start function to 'unit Lwt.t' #1524
Conversation
the CI reports:
And indeed, the toplevel "Mirage_net.listen" returns a "(unit, error) result Lwt.t", while now "unit Lwt.t" is demanded. The error message is unfortunately slightly confusing. Any chance we come up with a better one? |
Let me rephrase my comment: I'm in favour of merging this as is (and fix the mirage-skeleton dhcp example). It improves the current situation (and the struggle you had for nearly a day). |
I've found a way to have a better error message. Let's see if that also works in the CI. |
The error message is now:
|
e4d5a5c
to
60d5a6f
Compare
Right! I had other type constraint in my local test that interfered with my testing. I'm out of ideas of how to locate the error into user code. |
the latest error is:
could you run a The |
7fee732
to
c048550
Compare
I amended the last commit to use |
I opened mirage/mirage-skeleton#393 to fix the mirage-skeleton issue |
I'm happy with this change, the mirage-skeleton has been fixed. I don't understand why the CI doesn't catch up (I clicked on rebuild, but it reused the old mirage-skeleton). Any help is appreciated, maybe a force-push will solve something? |
This allows to catch subtle bugs caused by partial applications or by returning 'unit Lwt.t Lwt.t' using the type-system.
With this change, the error message is no longer about the pattern and looks clearer. Unfortunately, the location is still within generated code. This also requires adding the `'a io` type in the prelude. File "bin/mirage/mirage/main.ml", lines 300-305, characters 3-12: Error: This expression has type (unit, 'a) result Lwt.t but an expression was expected of type unit start = unit Lwt.t Type (unit, 'a) result is not compatible with type unit
c048550
to
2f9ed65
Compare
The CI is still failing after a rebase and a force push. I've run all the steps locally in the latest mirage-skeleton and it's building fine. |
I think I remember, the CI system uses the Thanks so much. EDIT: no need to do anything, CI kicked in automatically :) |
The checks are passing! |
This allows to catch subtle bugs caused by partial applications or by returning 'unit Lwt.t Lwt.t' using the type-system.