Closed
Description
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Readonly, type, annotation, alias, expand
Code
type Person = {
name: string;
}
type ReadOnlyPerson = Readonly<{
name: string;
}>
// hovering on x shows a type annotation of `Person`
let x: Person
// hovering on y shows a type annotation of Readonly<{ name: string }>
let y: ReadOnlyPerson
Expected behavior:
Type aliases should be preserved in annotations when using the Readonly
type. In the example above I would expect the type annotation for y
to be ReadOnlyPerson
Actual behavior:
Type alias is lost in the annotation when using the Readonly
type. The type annotation for y
in the example above is Readonly<{ name: string }
instead of ReadOnlyPerson
Related Issues:
I wasn't able to find any bugs that looked similar, when through a couple of pages of issues using the search terms mentioned above.