-
Notifications
You must be signed in to change notification settings - Fork 236
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 erasure of function types #3366
Comments
Options:
TODO: erase |
After giving this some more thought, I don't think we can make the arity version of the attribute work. Knowing the arity is enough to detect this issue, but not to produce the right code. During extraction, we still need to know which type to erase to: i.e., should we replace I only see two approaches left:
|
There's a third option. Generate |
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
This only works if extraction can see through the type definitions, in general this requires `--cmi`. Fixes #3366
(Following up on the discussion we just had.)
F* treats function types with an erasable codomain as erasable themselves. For example,
Type -> Type
is erasable. If such a function type is hidden behind an interface, then F* will replace values of that function type by()
which is incompatible with polymorphism. (In the same file, values of that type are erased tofun _ -> ()
which is fine.)The last definition will crash, because
x
is incorrectly erased to()
, andgeneric_apply
then treats it as a function and calls it.The text was updated successfully, but these errors were encountered: