Microsoft/TypeScript

Better display representation for intersection types

開放

#7,705 建立於 2016年3月27日

 (7 則留言) (3 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
Effort: DifficultHelp WantedSuggestion

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I'm not sure if this has been discussed before, but join types are mostly unreadable. I think the type should be prettified somehow before being displayed to the user.

TypeScript Version:

1.8

Code

type T1 = {};
type T2 = {test: number};
type J = T1 & T2;

Expected behavior:

var x: J;
typeof x; // {test: number}

Actual behavior:

var x: J;
typeof x; // {} & {test: number}

貢獻者指南