当代码中没有直接指定,并且类型推论也没有成功时,默认值会生效 function say<T = any>(name: T):void { alert(name)}say<string>('1') // oksay(true) // ok