rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Weird formatting when assigning function to ref

Open cknitt opened this issue 2 weeks ago • 1 comments

let f = ref(ignore)

// Ok
f.contents = () => {
  doA()
  doB()
}

// Weird
f :=
  (
    () => {
      doA()
      doB()
    }
  )

cknitt avatar Dec 04 '25 06:12 cknitt

And with an attribute, it gets weird in both cases:

let f = ref(ignore)

f.contents = @attr
() => {
  doA()
  doB()
}

f :=
  (
    @attr
    () => {
      doA()
      doB()
    }
  )

cknitt avatar Dec 07 '25 13:12 cknitt