Skip to content

Const strings should default to string literal type #7180

Closed
@tinganho

Description

@tinganho

Shouldn't const initialised with a string literal default to a string literal type?

const s = 'a';
let a: 'a';
a = s; // error today

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions