Skip to content

New Error: error TS2590: Expression produces a union type that is too complex to represent #45149

Description

@amcasey

Baseline: TS 4.3.2
Test: e064817

New error: error TS2590: Expression produces a union type that is too complex to represent.

Dependencies

    "@fluentui/react-northstar": "^0.56.0",
    "@types/react": "^16.9.11"

tsconfig.json

{
    "compilerOptions": {
        "strictNullChecks": true,
        "skipLibCheck": true,
        "jsx": "react",
    }
}

test.tsx

import { Alignment, ComponentSlotStylesPrepared, TeamsThemeStylesProps, ToolbarCustomItemProps, ToolbarItemProps } from "@fluentui/react-northstar";
import * as React from "react";

// No error if this is absent or at the end of the file
type Unused = ComponentSlotStylesPrepared<NonNullable<TeamsThemeStylesProps["ToolbarCustomItem"]>, any>;

type ItemProps = ToolbarItemProps | ToolbarCustomItemProps;

type ItemPropsWithTooltip = ItemProps & {
  key?: string;
  tooltip?: string;
  tooltipAlign?: Alignment;
};

declare const ToolbarItem: React.ElementType<ItemPropsWithTooltip>;
declare const props: ItemPropsWithTooltip;
const { tooltip, key, tooltipAlign, ...rest } = props;

const _ = <ToolbarItem {...rest} />; // TS2590

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions