【发布时间】:2020-02-18 14:53:22
【问题描述】:
当我尝试在泛型函数中使用递归类型别名时,TypeScript v3.7.5 会抛出 Type instantiation is excessively deep and possibly infinite.(2589)。
type State = {
head: {
title: string;
description: string;
metadata: { type: string; value: string }[];
};
body: {
title: string;
};
};
cons...
为什么会这样?有没有办法在不提供最大深度值(迭代器)的情况下解决这个问题?
【问题讨论】:
标签: typescript