Skip to content

Symbols should not be allowed as operands of arithmetic operations. #1750

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
function f() {
    var symbol = Symbol();

    try {
        symbol + "";
        return false;
    }
    catch(e) {}

    try {
        symbol + 0;
        return false;
    }
    catch(e) {}

    return true;
}

We should give an error on symbol + "" and symbol + 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions