Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix generation of interfaces for module types containing multiple type constraints#7825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@mediremi
Copy link
Member

@mediremimediremi commentedAug 30, 2025
edited
Loading

When creating an interface file withrescript-editor-analysis createInterface SomeFile.res, invalid syntax was being generated for module types containing multiple type constraints.

For example:

letmake= (typevalueidentity,  ~id:module(Belt.Id.Comparablewithtypet=valueandtypeidentity=identity),):t<value,identity>=> {// ...}

was being converted to interface:

letmake: (~id:module(Belt.Id.Comparablewithtypeidentity='awithtypet='b))=>t<'b,'a>

butwith type identity = 'a with type t = 'b is invalid syntax and should have beenwith type identity = 'a and type t = 'b (notice the secondwith becomesand).

res_outcome_printer did have existing logic to emitand instead ofwith, but it relied on a ref counter that was not being incremented.

print_out_type_doc typ;
]
in
incr i;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Without thisincr i,i.contents was always 0

@mediremimediremi marked this pull request as ready for reviewAugust 30, 2025 17:07
@pkg-pr-new
Copy link

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7825

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7825

@rescript/win32-x64

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

commit:70e2791

@mediremimediremi merged commit22f68af intorescript-lang:masterAug 31, 2025
25 checks passed
@mediremimediremi deleted the create-interface-module-multi-types branchAugust 31, 2025 09:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zthzthzth approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mediremi@zth

[8]ページ先頭

©2009-2025 Movatter.jp