Repository: TypeScript
Issue: "Type X is missing the following properties from type Y" showing the wrong properties
Labels: Bug,Help Wanted

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

* "is missing the following properties"
* missing properties message

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is the behavior in every version I tried, and I reviewed the FAQ

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.7.2&ssl=5&ssc=6&pln=5&pc=21#code/KYDwDg9gTgLgBDAnmYcAKUJgM4B4BKEA7gDRwDCEANtgHxwC8AUHHAGToCGA5gJYB2nGLwj8MWbC3ZwA3nAAmQzgC44AQShROiAsVoBuOAGNqAVwC2-bKoAiSgOJRe8ylQtXdpCtTqGAvvpMTEgoXHyCwqLiOIxSAD6ycGA8AkLAAPyqAGacNKh+8bJSrKzJ4WmqMFCmwIElJUammsD8MGg8wKr8FgBGwFB19QgQMLnt3MDWcN3mfQPFJaLkABac-BPjnXAAFGVbM3MAlIz04ua82MC4pvwA1vzE-AYLAUGgkLAIyKh2o47OrnceEIXlcdEYRVYAG0ANJwARwW7ARAQLLeGgAXVUgMsnjIYLIMOeryY72g8BCqBx-Dx6OwhORcFAMBa8mwiORqLp9AYkLgVE4fSoqmwVQE3EGExgADVcjVVNtMERVCDjgx6GDYciMZLgDAbBcwALELK3BkFUqVcQ1fRRU51oMoKz+tLeMAiJkdgA3OVbTUw7VkS1wVUnOB28WO51QACi8l4ME92ywMCmMgWwZBg1YPrN2J8WsQOoWFxjgh6VGA8lUPQg1GAa2z4b1pvl3t9+ZohYxNrgXogziblxlvqmu0wOFU7VgvFyuDBtF7-cHUj8vYjDqkuV43H45haidUACJK1kYEe4Akj0YD-0L1enNxlufAiTKeh+thRBC5ALRQA5Th9xFMV1jILJeCgACgK2DduDIHpIJgZZFBZWw0jgEkTCseAwAnKZojwNBP1EMg5CyUwqCoQDgPDUD4LgDoul6fpMJ5PlUJUOAoQxJhXiAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
export type Props<Row, Cols> =
  & PaginationProps
  & { data: Array<Row>; columns: DataGridColumns<Row, Cols>; };

type PaginationProps =
  | { paginate?: false }
  | {
      paginate: true;
      currentPage: number;
      totalPages: number;
      onChangePage: (page: number) => Promise<unknown>;
    };

export type DataGridColumns<Row, Cols> = {
  [K in keyof Cols]: Column<Row, Cols, K>;
};

export type Column<Row, Cols, Key extends keyof Cols> = {
  label: string;
  getValue: (row: Row) => Cols[Key];
  getDisplayValue?: (row: Row) => string;
  renderView?: (value: Cols[Key], row: Row) => string;
  renderEdit?: (opts: {
    row: Row;
    value: Cols[Key];
    isEnabled: boolean;
    setValue: (value: Cols[Key]) => void;
    setValues: (props: Partial<Cols>) => void;
  }) => string;
  alignment?: "left" | "center" | "right";
};

type Person = { lastName: string, firstName: string, birthdate: Date };

const props: Props<Person, { fullName: string, age: number }> = {
  data: []
};
```

### 🙁 Actual behavior

The error message for `props` is not that it's missing the required `columns` property but that it's missing properties from `PaginationProps`, which in actuality allows for the properties to be omitted.

```
Type '{ data: never[]; }' is not assignable to type 'Props<Person, { fullName: string; age: number; }>'.
  Type '{ data: never[]; }' is not assignable to type '{ paginate: true; currentPage: number; totalPages: number; onChangePage: (page: number) => Promise<unknown>; } & { data: Person[]; columns: DataGridColumns<Person, { fullName: string; age: number; }>; }'.
    Type '{ data: never[]; }' is missing the following properties from type '{ paginate: true; currentPage: number; totalPages: number; onChangePage: (page: number) => Promise<unknown>; }': paginate, currentPage, totalPages, onChangePage
```

### 🙂 Expected behavior

I should be told that I'm missing the `columns` property. In actuality this type is even more complex, and the bad error message makes it difficult to know which properties are actually missing without looking at the source code. Something like this would be more correct:

> Type '{ data: never[]; }' is imissing the following properties from type 'Props': columns