Skip to content

Create interface drops attributes in front of type declarations #9095

Description

@cknitt

Create interface (the editor's "Create interface file" command) drops attributes written in front of a type declaration:

@tag("kind") type tagged = A(int)

gives

             type tagged = A(int)

The type declaration is copied from the source starting at its location, which begins at type, after the attributes in front of it, so they are replaced by spaces. For @tag (and likewise @unboxed and other representation attributes) the generated .resi then no longer matches the implementation, because the signature check compares the variant's tag name.

This happens without any functor involved, also on master. Found while reviewing #9077, part of #9074.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions