作者:xie392地址:https://v.douyin.com/ieaCHTCg/更新时间:2024-12-21
1function log1<T>(x:T extends number ? never : T) {}2// log1(1) // error3// log1('1') // ok45type BandType<T,K> = T extends K ? never : T67function log2<T>(x:BandType<T,string>) {}8// log2(1) // ok9// log2('1') // error