Closed
Description
Bug Report
π Search Terms
- keyof 4.2
π Version & Regression Information
$ tsc --version
Version 4.2.0-dev
- This changed between versions 4.1.3 and 4.2.0-beta
β― Playground Link
π» Code
interface Point {
x: number;
y: number;
}
type Axes = keyof Point;
Mouse over Axes
.
π Actual behavior
Displays keyof Point
π Expected behavior
Displays "x" | "y"
.
I assume this is the result of #42284, but this display seems much less informative than what we used to have:
Having used keyof
in the past, I know that keyof Point
is the same as "x" | "y"
. But displaying its type as keyof Point
isn't very informative if you don't know that. I worry that this will make it much harder for new TypeScript users to understand how keyof
works.