Repository: TypeScript
Issue: Nominal/branded key for `Record` disables checking/inferring of value type
Labels: Suggestion,In Discussion

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

nominal, Record, branded

### 🕗 Version & Regression Information

3.3.3 through 4.3.2

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

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 for entries about nominal types and record types


### ⏯ 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.3.0-beta#code/C4TwDgpgBAkgJlAvFAzsATgSwHYHMoBkUA3lAPpmZwBcUA5FXVAL4BQrokUAqihOkhKsoUKrXgBuYVGwBDALYRaaLHilsO4aL34pBAJQgBjAPbo4AHngAaHn3QA+KZq470KAEyCAsrLBW4Wzcndk5texQAZgNjM0sVHFwg+xDWAHo0qAAVAAtMPQB3TAAbYpkTYCgwdBM4AFcjaFlsKH4a9HTMgAFgFABaCAAPSCNgAfR2qAA5ExkFaBQckzrihAAjJpa2swBCVlNsNCg6iNo3PWRSKgAGWiuaekZbZhZ2DKgw2gBtBLxbOuwAGtsCYCtgALpfcH7EyHSoQbAYTAQC5QADyawAVsZgAA6BFIlEAChOugAlM4DkdSe4PGcIl5kNgIAUoL4wESKZ0oD1+kMRmNtgIZnNFFUavVGnpmq0JmZWDTPLi+MAiQw4ExZHobCRRA91ZrtYEWGS3t1egNhjjxpMRXIxdVag0UVAZUKYXDjhFIvTdNFLnrbrqxI8Na6jc9XtzPlAfki-nZ+JDoVT4YisCj-eisTj8enkSgSd6uawgA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
type Id = string & { __id: 'id' }

type User = {
  id: Id;
  name: string;
}

type Users = Record<Id, User>;

type Users2 = Map<Id, User>;

type Users3 = Record<string, User>;

// This will not produce an error
// @ts-expect-error No name should be an error!
const users: Users = { id0: { id: 'id', } }

// type: [string, unknown][]
const entries = Object.entries(users);

const users2: Users2 = new Map();
// @ts-expect-error No name produces an error
users2.set('id' as Id, { id: 'id' as Id, })

// @ts-expect-error No name produces an error
const users3: Users3 = { id0: { id: 'id' as Id, } }

// type: [string, User][]
const entries3 = Object.entries(users3);
```

### 🙁 Actual behavior

<!-- What happened, and why it was wrong -->

Using a nominal/branded type as the key to a record type causes type checking of the `value` to be skipped. Additionally, inference will also fail and fallback to `unknown`, such as using `Object.entries`. Using a `Map` works as expected, but not a `Record`. I realize that the runtime behavior between a Map (real) and Record (type) is completely different, I'm just providing it as an example. 

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->

I'd expect types to be preserved and checked, even when using a nominal/branded type as a key to a record.