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

Several ADT improvements #687

Merged
merged 5 commits into from
Oct 3, 2023
Merged

Several ADT improvements #687

merged 5 commits into from
Oct 3, 2023

Conversation

Felalolf
Copy link
Contributor

@Felalolf Felalolf commented Oct 2, 2023

This PR adds several requested improvements for adts and fixes some past issues with adts:

  • the result of an adt constructor is now the declared type of the adt type definition (was a special clause type before)
  • arguments to adt literals now consider implicit conversions
  • match expressions can occur in assertions
  • the names of adt clause fields can be omitted
  • duplicate field names now cause a type error instead of a crash
  • duplicate clause names now cause a type error instead of a crash
  • adt clause name can be qualfied over the adt type
  • adt clause names do not cause name collision with other package entities (their precedence is set to lowest)
  • set and sequence operations (except conversions) are now more forgiving
  • importing adts is a bit more robust
  • fixed an issue with reorderings of match statement clauses

Adt clauses imported from another package can now be unreachable. Currently, qualified names of types must have at most one dot. However, with the new design, accessing an adt clause may require 2 dots, e.g. pkg.adtType.adtClause. This should be fixed in a future PR.

Fixes #686
Fixes #685
Fixes #641
Fixes #589

…argument, some incorrect handling of imported adts, conversion issues with ghost data types, name space conflicts with adt types. I changed the representation of adt types, which I still need to double check.
@Felalolf Felalolf requested a review from jcp19 October 2, 2023 10:48
Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patina! I just have a few minor comments

@jcp19 jcp19 merged commit 61d0bd9 into master Oct 3, 2023
2 of 3 checks passed
@jcp19 jcp19 deleted the 23-09-adt-fixes branch October 3, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants