Microsoft/TypeScript

Better display representation for intersection types

オープン

#7,705 opened on 2016/03/27

 (7 件のコメント) (3 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Effort: DifficultHelp WantedSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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}

コントリビューターガイド