Skip to content

TypeError on mixed operands #10

@littledan

Description

@littledan

This proposal follows BigInt in TypeErrors on mixed operands, e.g., BigInt + BigDecimal -> TypeError. Although it is possible to losslessly convert any Number or BigInt to a BigDecimal, the strictness here is intended to be part of a consistent mental model that developers should keep track of their numerical types and ensure uniformity. (The exception is comparison operators, which allow mixed types.) If people have concerns about this model, let's talk them through in this thread.

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