Skip to content

3.4.0-rc - behaviour changed from 3.3 (regression?) #30489

Closed
@xaviergonz

Description

@xaviergonz

I found a case where types yielded differ between 3.3 and 3.4, but I'm not sure if it is a regression or it is intended

interface I<T> {
    a: T
}

// this is different between 3.3 and 3.4
type O<T> = T extends I<any> ? T : never
type B = O<I<number>> // I<number> in TS3.3, I<any> & I<number> in TS3.4 (which boils down to I<any>

// this however is the same
type O2<T> = T extends I<infer _> ? T : never
type B2 = O2<I<number>> // I<number> in both

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions