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(backends/fstar): no __marker_trait if parent bounds #712

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

W95Psp
Copy link
Collaborator

@W95Psp W95Psp commented Jun 10, 2024

Parent bounds are translated as record fields in F*.  Also, F* classes
are records, and F* records cannot be empty. Thus, we insert a dummy
field `__marker_trait` on empty traits (marker traits).

On trait definitions, we were inserting this `__marker_trait` fields
only when a trait had no parent bounds and no associated item (method,
assoc. type, assoc fun.).

On instance definitons, we were inserting `__marker_trait` when the
trait was empty, disregarding parent bounds.

This difference of treatments lead to TC issues in F*.

This PR fixes this discrepancy.

@W95Psp W95Psp force-pushed the fstar-uniform-marker-trait branch 2 times, most recently from 8e81b61 to 430237c Compare June 12, 2024 13:14
@W95Psp W95Psp changed the title Fstar uniform marker trait fix(backends/fstar): no __marker_trait if parent bounds Jun 12, 2024
Parent bounds are translated as record fields in F*.  Also, F* classes
are records, and F* records cannot be empty. Thus, we insert a dummy
field `__marker_trait` on empty traits (marker traits).

On trait definitions, we were inserting this `__marker_trait` fields
only when a trait had no parent bounds and no associated item (method,
assoc. type, assoc fun.).

On instance definitons, we were inserting `__marker_trait` when the
trait was empty, disregarding parent bounds.

This difference of treatments lead to TC issues in F*.

This PR fixes this discrepancy.
@W95Psp W95Psp force-pushed the fstar-uniform-marker-trait branch from 430237c to ad92b26 Compare June 12, 2024 13:16
@W95Psp W95Psp marked this pull request as ready for review June 12, 2024 13:16
@karthikbhargavan karthikbhargavan self-requested a review June 13, 2024 09:55
@W95Psp W95Psp added this pull request to the merge queue Jun 13, 2024
Merged via the queue into main with commit 2db0e69 Jun 13, 2024
13 checks passed
@W95Psp W95Psp deleted the fstar-uniform-marker-trait branch June 13, 2024 10:35
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.

2 participants