Skip to content

Odd issues with $state and non-$state BigInts #14495

@Ocean-OS

Description

@Ocean-OS

Describe the bug

When using $stateful BigInts, I've encountered some weird bugs. I've found that there's some issues with these values when they are retrieved in different ways, such as:

  • Template effects always seem to work correctly with $state BigInts ([1]), but...
  • Using these values as they are (without putting it in an array or calling .toString() on it) results in odd behavior, sometimes it shows an outdated value or a value greater than what it ever has been [1][2]
  • Using these values in an array or in a method results in correct behavior (sometimes) [3]

Additionally, the compiler compiles ++ to +=1 (or (foo+=1)-1), and -- to -=1 (or (foo-=1)+1), which can result in some very ugly bugs. [4]

Reproduction

  1. REPL
  2. REPL
  3. REPL
  4. REPL

Logs

No response

System Info

N/A

Severity

more than annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions