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}

贡献者指南