-
Notifications
You must be signed in to change notification settings - Fork 98
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
Refactoring the typechecking error handling #85
Commits on Nov 28, 2018
-
[wip] Refactoring the typechecking error handling
I have a strong urge to refactor the error accumulation; this `recover_with` and `return_with` isn’t really pretty, adds quite useless noise to the code, and prevents easy use of existing combinators like `List.iter`. So I propose this: * We collect error messages and warnings in a mutable reference (a list or rope) that we just pass down as argument (inside `env`). This is used to collect errors (and warnings), but not for control flow. (This simulates the writer monad, without the syntactic overhead). * The exception no longer carries an argument. This is raised when we cannot continue due to an error. (This simulates the Maybe monad for computations-that-may-fail.) * There is a `recover_with` function that catches the Error, and continues with a useful default. * At the end, we report all errors and warnings in the mutable ref. And if there are any errors, we abort compilation. See `recover_and_report` Now any use of `error` does not abort futher processing, only `fatal_error` does. The code in `pipeline.ml` is maybe not the prettiest yet, but lets first see if this approach actually works inside `typing.ml`.
Configuration menu - View commit details
-
Copy full SHA for 5b47258 - Browse repository at this point
Copy the full SHA 5b47258View commit details -
Configuration menu - View commit details
-
Copy full SHA for b67b04a - Browse repository at this point
Copy the full SHA b67b04aView commit details -
Report warnings and errors differently
and more closely match what we had before
Configuration menu - View commit details
-
Copy full SHA for 58a700b - Browse repository at this point
Copy the full SHA 58a700bView commit details -
Make duplicate field error fatal
the function gather_field_exp is run thrice; not a good place for a non-fatal error. This could be refined to make sure the check happens only once, either by passing down a flag to exactly one invocation of `gather_field_exp`, or moving the check to a separate, explicitly used function alltogether.
Configuration menu - View commit details
-
Copy full SHA for bc9dbf5 - Browse repository at this point
Copy the full SHA bc9dbf5View commit details -
this means that now also warnings will be reported nicely! Will hopefully make @paulyoung even happier.
1Configuration menu - View commit details
-
Copy full SHA for 937f6c1 - Browse repository at this point
Copy the full SHA 937f6c1View commit details -
In
gather_pat
, do not check for duplicatesas these are checked elsewhere. Improves the error message.
Configuration menu - View commit details
-
Copy full SHA for 75a906e - Browse repository at this point
Copy the full SHA 75a906eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0cf6c3 - Browse repository at this point
Copy the full SHA e0cf6c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for b777064 - Browse repository at this point
Copy the full SHA b777064View commit details
Commits on Nov 29, 2018
-
Configuration menu - View commit details
-
Copy full SHA for fd4e3c4 - Browse repository at this point
Copy the full SHA fd4e3c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 972c02c - Browse repository at this point
Copy the full SHA 972c02cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e9af01 - Browse repository at this point
Copy the full SHA 0e9af01View commit details -
Configuration menu - View commit details
-
Copy full SHA for c9b2e0c - Browse repository at this point
Copy the full SHA c9b2e0cView commit details -
Move messages into the branches of
result
not sure if it really is better, but not worth arguing about.
Configuration menu - View commit details
-
Copy full SHA for 6ea19f3 - Browse repository at this point
Copy the full SHA 6ea19f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36b6f6c - Browse repository at this point
Copy the full SHA 36b6f6cView commit details -
More non-recoverable errors in the type checker
in particular, everything around sharable functions, and duplicate bindings.
Configuration menu - View commit details
-
Copy full SHA for 6368ceb - Browse repository at this point
Copy the full SHA 6368cebView commit details -
Merge remote-tracking branch 'origin' into typecheck-error-refactor
this pulls in #88 and addresses the nit that `typing.mli` should not mention the `errs` field.
Configuration menu - View commit details
-
Copy full SHA for 5908462 - Browse repository at this point
Copy the full SHA 5908462View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1e2059 - Browse repository at this point
Copy the full SHA e1e2059View commit details
Commits on Dec 3, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 86a1242 - Browse repository at this point
Copy the full SHA 86a1242View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fa56ac - Browse repository at this point
Copy the full SHA 5fa56acView commit details -
Configuration menu - View commit details
-
Copy full SHA for bf1ee05 - Browse repository at this point
Copy the full SHA bf1ee05View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9ff72c - Browse repository at this point
Copy the full SHA a9ff72cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f91fb4e - Browse repository at this point
Copy the full SHA f91fb4eView commit details -
hopefully we can resolve #92 soon, stack traces in the test output are a PITA (I should probably add a post-proccessing filter that normalizes the output a bit).
Configuration menu - View commit details
-
Copy full SHA for 61e0e5e - Browse repository at this point
Copy the full SHA 61e0e5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c2f0d8 - Browse repository at this point
Copy the full SHA 5c2f0d8View commit details -
Abstract common patterns between check_prog and infer_prog
the definiton of messages_result will eventually go into a separate module
1Configuration menu - View commit details
-
Copy full SHA for b0d6332 - Browse repository at this point
Copy the full SHA b0d6332View commit details