type BanDate<T>(x: T extends Date ? never : T //x可以是任何类型,但不能是日期 function log<T>(x: BanDate<T>) { console.log(x); }