Skip to content
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

Fix restricted open for constructors of type with indices #3558

Merged
merged 3 commits into from
Oct 12, 2024

Conversation

W95Psp
Copy link
Contributor

@W95Psp W95Psp commented Oct 12, 2024

Consider the following type:

type foo (foo_type_arg1: nat): foo_type_arg2:nat -> Type
  = | FooConstructor : foo_cons_arg1:nat -> foo foo_type_arg1 12

Function find_binders_for_datacons exporting foo_type_arg1, foo_type_arg2 and foo_cons_arg1 as binders for the data constructor FooConstructor. This was wrong: the first two are indices of the type.

This commit fixes this function, using the field num_ty_params from the constructor Sig_datacon.

This PR fixes #3522.

Consider the following type:
```fstar
type foo (foo_type_arg1: nat): foo_type_arg2:nat -> Type
  = | FooConstructor : foo_cons_arg1:nat -> foo foo_type_arg1 12
```

Function `find_binders_for_datacons` exporting `foo_type_arg1`,
`foo_type_arg2` and `foo_cons_arg1` as binders for the data
constructor `FooConstructor`. This is wrong: the first two are
indicies of the type.

This commit fixes this function, using the field `num_ty_params` from
the constructor `Sig_datacon`.
@W95Psp W95Psp changed the title Fix restricted open Fix restricted open for constructors of type with indices Oct 12, 2024
@mtzguido mtzguido merged commit 62ea88d into FStarLang:master Oct 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition not found with restricted open
2 participants