mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 12:41:20 +08:00
@ -1557,8 +1557,8 @@ const a = <T extends string>(t: T) => t;
|
|||||||
const b = <T extends number>(t: T) => t;
|
const b = <T extends number>(t: T) => t;
|
||||||
const c = <T extends boolean>(t: T) => t;
|
const c = <T extends boolean>(t: T) => t;
|
||||||
const d = a("a"); // const d: 'a'
|
const d = a("a"); // const d: 'a'
|
||||||
const e = a(1); // const d: 1
|
const e = b(1); // const d: 1
|
||||||
const f = a(true); // const d: true
|
const f = c(true); // const d: true
|
||||||
|
|
||||||
// 这里t的类型用了一个展开运算
|
// 这里t的类型用了一个展开运算
|
||||||
const g =
|
const g =
|
||||||
|
Reference in New Issue
Block a user