Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DanielRosenwasser opened this issue Jan 21, 2015 · 0 comments · Fixed by #1978
Closed

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

DanielRosenwasser opened this issue Jan 21, 2015 · 0 comments · Fixed by #1978
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jan 21, 2015

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.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Breaking Change Would introduce errors in existing code ES6 Relates to the ES6 Spec labels Jan 21, 2015
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 1.5 milestone Jan 21, 2015
@RyanCavanaugh RyanCavanaugh removed ES6 Relates to the ES6 Spec Breaking Change Would introduce errors in existing code labels Jan 21, 2015
@danquirk danquirk added the Fixed A PR has been merged for this issue label Feb 18, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants