Skip to content

Incrementing/decrementing BigInt $states throws an error #14484

@Ocean-OS

Description

@Ocean-OS

Describe the bug

When compiling foo++ and bar-- statements (assuming that foo and bar are $states), Svelte assumes that foo and bar are numbers, and compiles it to $.update(foo) and $.update(bar, -1). However, if foo or bar are BigInts, this causes an error because numbers and BigInts cannot be mixed together without type conversion.
I have a PR ready for this.

Reproduction

REPL

Logs

No response

System Info

N/A

Severity

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