Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of external with as attribute and _ placeholder #6970

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests
  • Loading branch information
Shulhi Sapli committed Aug 24, 2024
commit 24afb1b4a93d6ac1f99daeba52f1540ca65c4ea1
27 changes: 27 additions & 0 deletions jscomp/syntax/tests/printer/other/attributes.res
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,30 @@ let x = 1
)
let x = 1

@obj external ff: (~x: int, ~g: int, ~h: int) => _ = ""

@obj external ff: (~x: int, ~g: int, ~h: @as(3) _) => _ = ""

@obj external ff: (~x: int) => (~h: @as(3) _) => _ = ""

@obj
external ff: (
~lo: @as(3) _,
~mid: @as(3) _,
~hi: int,
) => _ = ""


@obj
external ff: (
~hi: int,
~lo: @as(3) _
) => _ = ""

@obj
external ff: (
~hi: int,
~mid: @as(3) _,
~lo: @as(3) _
) => _ = ""

15 changes: 15 additions & 0 deletions jscomp/syntax/tests/printer/other/expected/attributes.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ let x = 1

@inlinePrivate(@module("./logo.svg") external logo: string = "default")
let x = 1

@obj external ff: (~x: int, ~g: int, ~h: int) => _ = ""

@obj external ff: (~x: int, ~g: int, ~h: @as(3) _) => _ = ""

@obj external ff: (~x: int) => (~h: @as(3) _) => _ = ""

@obj
external ff: (~lo: @as(3) _, ~mid: @as(3) _, ~hi: int) => _ = ""

@obj
external ff: (~hi: int, ~lo: @as(3) _) => _ = ""

@obj
external ff: (~hi: int, ~mid: @as(3) _, ~lo: @as(3) _) => _ = ""