Skip to content

Represent inline record definitions with a type declaration origin - #8686

Merged
cknitt merged 2 commits into
codex/immutable-pexp-attributesfrom
codex/inline-record-origin
Sep 28, 2026
Merged

cknitt merged 2 commits into
codex/immutable-pexp-attributesfrom
codex/inline-record-origin

Conversation

@cknitt

@cknitt cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Represent parser-generated inline record declarations with ptype_origin in the current parsetree, instead of a synthetic res.inlineRecordDefinition attribute.
  • Update the printer, type checker, and editor hover to use the explicit origin or the existing typed inline-record metadata.
  • Keep external PPXs compatible: the v0 AST bridge restores the marker on the wire and decodes it back into ptype_origin when returning to the current AST.
  • Bump the current AST, CMI, and CMT magic numbers for the changed parsetree layout. The frozen v0 PPX wire format stays unchanged.

Tests

  • make test
  • make test-syntax-roundtrip
  • make test-analysis

Part of #8624. Stacked on #8685.

@cknitt
cknitt marked this pull request as ready for review September 27, 2026 14:51
@cknitt
cknitt added this pull request to stack #8683 September 27, 2026 14:55
@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (codex/immutable-pexp-attributes@cfd2c2a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
compiler/syntax/src/res_parsetree_viewer.ml 0.00% 3 Missing ⚠️
compiler/ml/printast.ml 50.00% 2 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##             codex/immutable-pexp-attributes    #8686   +/-   ##
==================================================================
  Coverage                                   ?   78.67%           
==================================================================
  Files                                      ?      476           
  Lines                                      ?    64402           
  Branches                                   ?        0           
==================================================================
  Hits                                       ?    50670           
  Misses                                     ?    13732           
  Partials                                   ?        0           
Files with missing lines Coverage Δ
analysis/src/hover.ml 77.12% <100.00%> (ø)
compiler/frontend/ast_derive_util.ml 87.50% <ø> (ø)
compiler/ml/ast_helper.ml 81.81% <100.00%> (ø)
compiler/ml/ast_mapper.ml 77.89% <ø> (ø)
compiler/ml/ast_mapper_to0.ml 71.80% <100.00%> (ø)
compiler/ml/typedecl.ml 82.63% <100.00%> (ø)
compiler/ml/typetexp.ml 87.33% <ø> (ø)
compiler/syntax/src/res_ast_debugger.ml 96.98% <100.00%> (ø)
compiler/syntax/src/res_core.ml 91.93% <ø> (ø)
compiler/syntax/src/res_printer.ml 93.42% <100.00%> (ø)
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

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

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8686

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit: ab2241b

@cknitt
cknitt force-pushed the codex/inline-record-origin branch from 14b17f5 to 37d1e7a Compare September 27, 2026 15:14
@cknitt
cknitt force-pushed the codex/inline-record-origin branch from 37d1e7a to 94ab6c4 Compare September 27, 2026 16:21
@cknitt
cknitt force-pushed the codex/inline-record-origin branch from 94ab6c4 to e0ae90d Compare September 27, 2026 17:15
@cknitt
cknitt force-pushed the codex/inline-record-origin branch from e0ae90d to f3715fa Compare September 27, 2026 17:33
@cknitt
cknitt force-pushed the codex/inline-record-origin branch from f3715fa to e8411db Compare September 27, 2026 18:56
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt
cknitt force-pushed the codex/inline-record-origin branch from e8411db to ab2241b Compare September 27, 2026 20:02
@cknitt
cknitt merged commit ece8b14 into master Sep 28, 2026
24 checks passed
@cknitt
cknitt deleted the codex/inline-record-origin branch September 28, 2026 05:57
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