0no-co/wonka

Runtime error when used with BuckleScript 8.1.0

gaku-sei opened this issue · 3 comments

The new BS version seems to break, at runtime, the wonka take function:
Capture d’écran 2020-06-23 à 11 55 23

The generated code for the take function looks something like this:

if (state.taken < max) {
  if (signal) {
    state.taken = max;
    return state.talkback(/* Close */1); // Breaks here
  } else {
    return state.talkback(/* Pull */0);
  }
}

When logging, the stage.talkback propery is indeed undefined 😞

Tried looking at this, how this can even happen? isnt the whole point of Reasonml is to avoid such issues?

@gaku-sei that’s pretty interesting! I can take a look at the BS changes, but can you send the affected code snippet over please so I can get an initial idea of why the talkback isn’t set?

@kitten the issue here is bs8 changed internal representation of variant from tag to TAG and 0 to _0 so dist need to be compiled with bs8 or it won't work