Skip to content

Conversation

@nojaf
Copy link
Member

@nojaf nojaf commented Jan 16, 2026

For example

type listObjectsResponse = {
  commonPrefixes?: array<{prefix: string}>,
  contents?: array<
    {
      checksumAlgorithm?: [#CRC32 | #CRC32C | #SHA1 | #SHA256 | #CRC64NVME],
      checksumType?: [#COMPOSITE | #FULL_OBJECT],
      etag?: string,
      isLatest?: bool,
      key?: string,
      lastModified?: string,
      owner?: {displayName?: string, id?: string},
      restoreStatus?: string,
      size?: float,
      storageClass?: storageClass,
    },
  >,
  isTruncated?: bool,
  keyCount?: float,
  maxKeys?: float,
  name?: string,
  nextContinuationToken?: string,
  prefix?: string,
  startAfter?: string,
}

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for ReScript v12 nested record types, allowing record type syntax to be used inline within generic type arguments, function type parameters, and other type contexts where previously only named types could be used.

Changes:

  • Added record_type to _non_function_inline_type grammar rule to enable nesting
  • Added a new precedence conflict rule between _type and _non_function_inline_type
  • Added comprehensive test cases demonstrating nested record types in various contexts

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
grammar.js Added record_type to _non_function_inline_type choice and new conflict rule for disambiguation
src/grammar.json Generated grammar file reflecting the grammar.js changes
src/node-types.json Updated node type definitions to include record_type in function_type_parameters, polymorphic_type, polyvar_declaration, type_annotation, and type_binding children
test/corpus/type_declarations.txt Added three test cases covering nested records in different contexts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@aspeddro aspeddro left a comment

Choose a reason for hiding this comment

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

🎉

@nojaf nojaf merged commit 5938ae1 into rescript-lang:main Jan 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants