Closed
Description
TypeScript Version: 2.9.1
Search Terms:
keyof well known symbol
Code
const s = Symbol("s");
interface I {
n: number;
[s]: string;
[Symbol.iterator](): IterableIterator<[string, string]>;
}
type K = keyof I;
type T = I[K];
Expected behavior:
type K = keyof I; // type K = typeof s | "n" | typeof Symbol.iterator
type T = I[K]; // type T = string | number | () => IterableIterator<[string, string]>
Actual behavior:
type K = keyof I; // type K = typeof s | "n"
type T = I[K]; // type T = string | number