Skip to content

inconsistencies with string literal values after always use literal types pr #13705

Closed
@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

nightly build jan 26

interface Wrapped<T> {
    wrapped: T;
}
function wrap<T>(value: T): Wrapped<T> {
    return { wrapped: value };
}

const one = 'test'; // one is 'test'
const oneWrapped = wrap(one); // oneWrapped is Wrapped<string>

const another: 'test' = 'test'; // another is 'test'
const anotherWrapped = wrap(another); // anotherWrapped is Wrapped<'test'> <--- WHY?

is that how #10676 supposed to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions