-
Notifications
You must be signed in to change notification settings - Fork 237
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
Incorrect type inference leads to type-incorrect OCaml code #1158
Comments
Note that requires
|
I think this is expected, the lax mode drops the VC, so the constraint |
Which part? Isn't producing incorrectly-typed OCaml code an issue? |
Not in the lax mode, as far as I know (trying to find a similar issue). |
Oh, may be I misunderstood what you mean, do you mean F* should have inserted enough magic to make it compile (but running that program could crash at run time)? |
ok, i see it now, the inference indeed looks strange. |
No, I think you understood me right :) I think it's an issue that a program that typechecks and extracts with |
But I still don't see why is F* inferring the return type of |
Right, |
It's actually not that bad, F* inserts enough
So I'm actually not sure whether
|
A small variant of Aseem's example (which also lax-typechecks)
also causes a segmentation fault by basically converting an integer to a pointer and then dereferencing it. Funny enough, if I call
|
Came across this issue with @aseemr today. It seems there are two parts to it:
|
Here's another occurrence of it:
|
This code:
…extracts with a bunch of
Obj.magic
. They go away if I add an explicit type onaux
(list<(list<string> * 'b)>
).Investigating reveals that F* infers this type:
This looks wrong to me. That
'a
in the end should be a'b
. This leads to an inconsistency (not in Tot, though):To extract I used
../../bin/fstar.exe "--eager_inference" "--lax" "--MLish" "--include" "../../ulib" "--include" "../u_boot_fsts" "--include" "../boot_fstis" --codegen OCaml mini.fst
The text was updated successfully, but these errors were encountered: