• Geek_aeb936
    2024-08-10 来自日本
    https://github.com/aimingoo/jike2/tree/main/src/31 我看好像没有t3.ts文件(课后作业)

    作者回复: 谢谢提醒,已追加。:)

    
    
  • Geek_aeb936
    2024-08-10 来自日本
    type SuperFoo<T> = <X>(x: T) => X; const mySuperFoo: SuperFoo<number> = <X>(x: number): X => { return (x as unknown) as X; }; const result = mySuperFoo<string>(42); type ResultType = typeof result; // type ResultType = string

    作者回复: +1 👍

    
    