Microsoft/TypeScript

Better display representation for intersection types

Open

#7,705 创建于 2016年3月27日

在 GitHub 查看
 (7 评论) (3 反应) (0 负责人)TypeScript (6,726 fork)batch import
Effort: DifficultHelp WantedSuggestion

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 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}

贡献者指南