-
Notifications
You must be signed in to change notification settings - Fork 0
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
type inference for recursive functions #104
Conversation
@@ -2,6 +2,8 @@ | |||
open Core.Std | |||
open Sast | |||
|
|||
exception CantInferType of string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant_infer_type
Read all the code and logic looks good. Give me a bit more time to digest and play around with the branch. |
try Some(sast_expr_env expr) | ||
(* Note that CantInferType is raised when an nh function has already | ||
been seen higher up in the ast and it's not in tfuns_ref either *) | ||
with CantInferType(_) -> None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note if force was set to true (from the FunApply case), this case should not trigger. I could add that to the comments.
This would be a good negative test case, if we had them (#102):
For reference, the error message given is:
|
| None -> let fake_sexpr = (Sast.LitUnit, case_true_t) in | ||
Sast.Conditional((condition, condition_t), fake_sexpr, fake_sexpr), case_true_t | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of copy-pasted code here. It's not too bad so I filed tech debt #106 to fix it.
squash 'n 📧 📤 🏃 📮 🚚 |
got rid of unnecessary field in custom exception made some things more ocamllic
3d5f026
to
11feaab
Compare
type inference for recursive functions
No description provided.