From c70a95e007a848e73073ec90eb1ea426611eaa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F?= <2553241022@qq.com> Date: Sat, 23 Sep 2023 18:10:09 +0800 Subject: [PATCH] doc: update typescript.md (#440) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正 范型推导出列表字面量内示例代码错误 --- docs/typescript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/typescript.md b/docs/typescript.md index 94cbc52..e9059cc 100644 --- a/docs/typescript.md +++ b/docs/typescript.md @@ -1557,8 +1557,8 @@ const a = (t: T) => t; const b = (t: T) => t; const c = (t: T) => t; const d = a("a"); // const d: 'a' -const e = a(1); // const d: 1 -const f = a(true); // const d: true +const e = b(1); // const d: 1 +const f = c(true); // const d: true // 这里t的类型用了一个展开运算 const g =