Skip to content

Allow template strings (with no interpolated expressions) to start off with literal types #16592

@DanielRosenwasser

Description

@DanielRosenwasser

I can't find the original issue (if there is one).

const c: "hello" = `hello`

Expected: No error.
Actual: Type 'string' is not assignable to type '"hello"'.

We should just allow people to use NoSubstitutionTemplates the way that they're allowed to use regular strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Literal TypesUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions