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

Refactor type_descriptions in the typing env #10307

Merged
merged 1 commit into from
May 7, 2021

Commits on May 7, 2021

  1. Refactor type_descriptions in the typing env

    For new datatype definitions the typer records "declarations",
    which are mostly direct information obtained from the program source,
    and "descriptions", which contains lower-level, computed information
    on data representation (constructor tags, record field offsets).
    
    Before this PR, the type used to define datatype descriptions was
    
       type type_descriptions =
         constructor_description list * label_description list
    
    which basically assumes that a datatype may have both constructors and labels, which is nonsensical.
    
    The current refactoring uses a variant instead of a product here,
    following the existing structure of the 'type_kind' field of
    declarations. This avoids having to use empty lists in impossible
    configurations, and makes the code less surprising.
    Nicolas Chataing committed May 7, 2021
    Configuration menu
    Copy the full SHA
    5d26dfc View commit details
    Browse the repository at this point in the history