Skip to content

Support inline records in external definitions#8304

Open
zth wants to merge 3 commits intomasterfrom
inline-records-externals
Open

Support inline records in external definitions#8304
zth wants to merge 3 commits intomasterfrom
inline-records-externals

Conversation

@zth
Copy link
Member

@zth zth commented Mar 18, 2026

Support inline record definitions in externals:

@module("node:fs")
external readFileSync: (
  string,
  ~options: {
    encoding?: [#utf8 | #ascii | #base64],
    flag?: string,
    misc?: {
      mode?: int,
    },
  },
) => option<{filename: string, size: string}> = "fs.readFileSync"

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

let typ = parse_arrow_type_rest ~es6_arrow:true ~start_pos typ p in

P1 Badge Thread inline-record context into nested bare arrows

When an external parameter is itself a bare arrow type that starts with an identifier, this branch constructs the left-hand side and then calls parse_arrow_type_rest without current_type_name_path or inline_types_context. For example, external withTransform: (int => {id: string}) => unit = ... will parse the nested {id: string} return with no inline-record context, so it falls back to object-type parsing instead of synthesizing withTransform.arg0.return.type. Top-level inline records work, but callback parameters like this still fail.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 18, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8304

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8304

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8304

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8304

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8304

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8304

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8304

commit: d2d95f3

@zth
Copy link
Member Author

zth commented Mar 18, 2026

@codex review

@zth zth requested review from cknitt, nojaf and shulhi March 18, 2026 14:56
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2d95f3a72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zth zth added this to the v13 milestone Mar 18, 2026
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.

1 participant