I’m working on porting my websocket implementation from reason to rescript, and remembered how much this annoyed me:
@bs.send external on: ( t, @bs.string [ | #close((int, string) => unit) | #message(string => unit) | @bs.as("open") #open_(unit => unit) | #ping(Node.Buffer.t => unit) | #pong(Node.Buffer.t => unit) | #error(Dom.errorEvent => unit) ], ) => t = "on"
Is there a reason that polymorphic variants can’t use reserved words, since afaik they’re always marked by a
#? Or is it something that just hasn’t been deemed necessary.