<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with the latest published version. It may have already been fixed. For npm: `typescript@next` This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly --> **TypeScript Version:** 3.9.x <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** keyof, index signature **Code** ```ts interface Test1 { [key: string]: string; } type KeyofTest1 = keyof Test1 interface Test2 { [key: number]: string; } type KeyofTest2 = keyof Test2 ``` **Expected behavior:** - `KeyofTest1 ` should be `string` - `KeyofTest2` should be `number` **Actual behavior:** - `KeyofTest1 ` is `string | number` (**wrong**) - `KeyofTest2` is `number` (correct) **Playground Link:** https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=12&pc=1#code/JYOwLgpgTgZghgYwgAgCoQM5gIzIN4BQyxyA2gNYQCeAXMllKAOYC6dDzA3AQL4EFgqABxQBpagHsY6LLgC8ySlSlpMOfqEixEKGWABM+IiQrU6IAK4BbAEbQ29MIxBNufAcLGTpawwqUqevoEQA **Related Issues:** <!-- Did you find other bugs that looked similar? -->