Skip to content

Nested constructor produces unhelpful function union #12

@samhh

Description

@samhh
type A = Member<'A1', string> | Member<'A2', number>
type B = Member<'B1', A>

const { B1 } = create<B>()
declare const x: A
B1(x)
Diagnostics:
1. Argument of type 'A' is not assignable to parameter of type 'never'.
  The intersection 'Member<"A1", string> & Member<"A2", number>' was reduced to 'never' because property '[tagKey]' has conflicting types in some constituents.
    Type 'Member<"A1", string>' is not assignable to type 'never'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions