five-dots / Dict

R6 Based Key-Value Dictionary Implementation
Other
4 stars 0 forks source link

Wierd "Can't combine..1key" error when creating a dictionary #1

Open JJ opened 2 years ago

JJ commented 2 years ago

Here you go:

node.type.dict <- Dict$new()
Error: Can't combine `..1$key` <character> and `..2$key` <integer>.
Run `rlang::last_error()` to see where the error occurred

Which returns:

<error/vctrs_error_incompatible_type>
Can't combine `..1$key` <character> and `..2$key` <integer>.
Backtrace:
  1. Dict$new()
  2. .subset2(public_bind_env, "initialize")(...)
  3. self$add(...)
  4. dplyr::bind_rows(private$.items, new_items)
  5. vctrs::vec_rbind(!!!dots, .names_to = .id)
  7. vctrs::vec_default_ptype2(...)
  8. vctrs::stop_incompatible_type(...)
  9. vctrs:::stop_incompatible(...)
 10. vctrs:::stop_vctrs(...)
Run `rlang::last_trace()` to see the full context.
five-dots commented 2 years ago

Thank you for raising the issue. The current implementation did not support initializing an empty dict yet. I've implemented it in the develop branch, can you try it out?

remotes::install_github("five-dots/Dict@develop")
library(Dict)
node.type.dict <- Dict$new()

If you have any problems, I would appreciate your comments.

JJ commented 2 years ago

Will do. Thanks!

JJ commented 1 year ago

This works. Thanks!