Skip to content

CreateInterface.command doesn't copy over @as decorators in records #7611

Open
@mediremi

Description

@mediremi

From the following:

type t = {@as("type") type_: string}

createInterface produces:

type t = {type_: string}

But this is not valid, as the @as decorator is missing:

  We've found a bug for you!
  /some/path/SomeFile.res:1:1-36

  1 │ type t = {@as("type") type_: string}
  2 │ 

  The implementation /some/path/SomeFile.res
  does not match the interface js/SomeFile.cmi:
  Type declarations do not match:
    type t = {type_: string}
  is not included in
    type t = {type_: string}
  /some/path/SomeFile.resi:1:1-24:
    Expected declaration
  /some/path/SomeFile.res:1:1-36:
    Actual declaration
  Fields number 1 have different names, type and type_.

(There's another issue here, which is that the error message type t = {type_: string} is not included in type t = {type_: string} is confusing)

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