Skip to content

Cannot convert a Symbol value to a string #12169

@unional

Description

@unional

tsc: 2.1.0-dev.20161110

function foo(x: symbol) {
    console.log(`abc ${x}`)
}

transpile to:

function foo(x) {
    console.log("abc " + x);
}

results in "Cannot convert a Symbol value to a string" error at runtime.

http://www.typescriptlang.org/play/#src=function%20foo(x%3A%20Symbol)%20%7B%0D%0A%20%20%20%20console.log(%60abc%20%24%7Bx%7D%60)%0D%0A%7D

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