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
Playground Link:
http://www.typescriptlang.org/play/?ts=3.7-Beta&ssl=10&ssc=22&pln=1&pc=1#code/C4TwDgpgBAChBOBnA9gOygXigbwFBQKlQEMBbCALikWHgEtUBzAblwF9ddRIoAlCYgBMA8qgA2IOEjSY+AwWgkAePISJlK1WgxbsAfJzERgUAB5UpKVLiMmQVfkNETLaIA
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.
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Readonly, type, annotation, alias, expand
Code
Expected behavior:
Type aliases should be preserved in annotations when using the
Readonlytype. In the example above I would expect the type annotation foryto beReadOnlyPersonActual behavior:
Type alias is lost in the annotation when using the
Readonlytype. The type annotation foryin the example above isReadonly<{ name: string }instead ofReadOnlyPersonPlayground Link:
http://www.typescriptlang.org/play/?ts=3.7-Beta&ssl=10&ssc=22&pln=1&pc=1#code/C4TwDgpgBAChBOBnA9gOygXigbwFBQKlQEMBbCALikWHgEtUBzAblwF9ddRIoAlCYgBMA8qgA2IOEjSY+AwWgkAePISJlK1WgxbsAfJzERgUAB5UpKVLiMmQVfkNETLaIA
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.