Skip to content

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

Closed

Description

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.

Activity

  1. added
    Bug
    Domain: Literal Types
    Suggestion
    and removed
    Bug
    on Jun 16, 2017
  2. ericbf commented on Sep 5, 2017

    @ericbf
    Contributor

    This should also cover using NoSubstitutionTemplates as literal types as in #18109

  3. ericbf commented on Sep 13, 2017

    @ericbf
    Contributor

    Is there any progress being made on this?

    Andy (Andrewkraft) (@Andy-MS) the PR that referenced this issue didn't completely resolve the cases covered by using NoSubstitutionTemplates as literal types.

  4. added
    Bug
    and removed
    Suggestion
    on Sep 13, 2017
  5. ghost closed this as completedin #18452on Sep 14, 2017
  6. ghost added
    Fixed
    on Sep 14, 2017
  7. locked and limited conversation to collaborators on Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDomain: Literal TypesFixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions