Skip to content

v12 regression; gentype of record with escaped record fields generates invalid Typescript code #8086

@illusionalsagacity

Description

@illusionalsagacity

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant.
  • Is it already fixed in master? Instructions

The following rescript code

@genType
type t = {
  \"Illegal-field name": int,
}

results in this:

export type record = {
  readonly "\"Illegal-field name"": number
};

The extra trailing " makes this invalid syntax, and the leading \" doesn't match the generated javascript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions