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

Nested object get and set not working in res files #489

Closed
rizo opened this issue Feb 16, 2023 · 1 comment · Fixed by #533
Closed

Nested object get and set not working in res files #489

rizo opened this issue Feb 16, 2023 · 1 comment · Fixed by #533
Assignees

Comments

@rizo
Copy link

rizo commented Feb 16, 2023

Nested object set syntax is currently rejected with an assert false triggered at

| _ -> assert false)

Input:

obj["foo"]["bar"] = 42

Error:

dune build @melange
File "src/ui/.ui.objs/melange/_unknown_", line 1, characters 0-0:
melc: internal error, uncaught exception:
      File "jscomp/frontend/ast_exp_apply.ml", line 252, characters 17-23: Assertion failed

Additionally, there's a related bug in nested gets.

x["foo"]["bar"]

Produces an incorrect compiled output:

x.bar
@jchavarri
Copy link
Member

I got a repro in #533, seems the problem is somewhere in rescript conversion, instead of generating:

let () = ((entry ## person) ##  age) #= 99

it generates:

let () = ((entry ## person) #  age) #= 99

jchavarri added a commit that referenced this issue Apr 11, 2023
* main:
  melange: Add a `melpp` executable that just preprocesses conditionals (#539)
  Promote test files (#537)
  chore: update nix flake (#536)
jchavarri added a commit that referenced this issue Apr 11, 2023
* main:
  update dune to latest (#540)
jchavarri added a commit that referenced this issue May 4, 2023
* main:
  feat(melange): add `--preamble` for e.g. "use client" (#545)
  fix(ci): never re-run the `anonymous` function
  test: interaction between `[@@@bs.config {flags = ...}]` and `--as-ppx`
  melange: delete dead code across the ext library (#552)
  melc: delete Ext_json and related modules, use dune-build-info for (#551)
  melc: remove old namespace system, legacy mode (#550)
  chore: changelog entry for #548
  feat(melange): installable and usable in more OCaml versions (#548)
  fix(melange): improve error message for file-level flags handler (#549)
  melange: allow vendoring without having node.js installed (#547)
  [lite-version] Separate into melange.ppx and melange.ppx-lib (#534)
  chore: remove mel (#546)
  chore: update flakes (#543)
  Add test for doc comment attached to `%%private` (#542)
jchavarri added a commit that referenced this issue May 5, 2023
* main:
  [@new @varidic]: use `Function.prototype.bind` instead of `new C(...args)` (#558)
  Fix a warning when compiling the C stubs with OCaml 5 (#5887)
  Fix typo in error message (#5823)
  Fix typo
  Modify jscomp/runtime/js.ml too
  Add placeholder types for ES6 collections
  fix Js_math deprecation message
  Turn on optimizations for unicode strings.
  Add new function to Option: orElse (#5400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants