Rescript-compiler: Caml_chrome_debugger.variant expecting 3 arguments, got 2 instead

Created on 28 Jun 2019  路  2Comments  路  Source: rescript-lang/rescript-compiler

I'm getting errors after upgrading bs-platform from v5.0.4 to v.5.0.5

TypeError: Cannot set property 'tag' of undefined
    at Object.variant (/Users/banacorn/github/agda-mode/node_modules/bs-platform/lib/js/caml_chrome_debugger.js:189:10)
    at Object.<anonymous> (/Users/banacorn/github/agda-mode/lib/js/src/View/Root.bs.js:30:67)
....

It turned out that Caml_chrome_debugger.variant is expecting 3 arguments:

https://github.com/BuckleScript/bucklescript/blob/a114b81b60d8c88266a1ce1cadd74d20b14a5786/lib/js/caml_chrome_debugger.js#L187-L193

However, the generated code is given only 2 arguments.
Here's an example:

var initialState_000 = /* mountAt : Bottom */Caml_chrome_debugger.variant("Bottom", [createBottomPanel(/* () */0)]);

Removing the -bs-g flag from bsconfigs.json would strip all Caml_chrome_debugger away, and thus preventing this from happening as expected.

EDIT: grammar

bug

All 2 comments

hi @banacorn sorry for the inconvenience, will make a bug fix release this weekend

fixed in #3637

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobzhang picture bobzhang  路  4Comments

TheSpyder picture TheSpyder  路  5Comments

alexfedoseev picture alexfedoseev  路  5Comments

bobzhang picture bobzhang  路  3Comments

zhzhang picture zhzhang  路  4Comments