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

@this is breaking in rescript v11 #6638

Closed
seekshiva opened this issue Feb 13, 2024 · 3 comments · Fixed by #7025
Closed

@this is breaking in rescript v11 #6638

seekshiva opened this issue Feb 13, 2024 · 3 comments · Fixed by #7025
Assignees

Comments

@seekshiva
Copy link

seekshiva commented Feb 13, 2024

This doesn't work: link

Storing the fn in a variable and then returning it works. Link

@fhammerschmidt
Copy link
Member

Seems to only happen in uncurried mode.
cc @cristianoc

@seekshiva
Copy link
Author

seekshiva commented Feb 14, 2024

It seems like wrapping the @this {fn definition} inside of {} is causing issues. We were able to fix it by changing from {} to ()

Screenshot 2024-02-14 at 8 35 31 AM

@alex35mil
Copy link
Contributor

Came here to report an issue with @this as well.

Playground

type t

@send
external on: (
  t,
  @string
  [
    | #a(t => unit)
    | #b(@this (t => unit)) // ← spot ()
  ],
) => t = "on"

// format
// ↓ ↓ ↓

type t

@send
external on: (
  t,
  @string
  [
    | #a(t => unit)
    | #b(@this t => unit) // ← () dropped
  ],
) => t = "on"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants