If
提出詳細
type If<C,T,F> = C extends true ? T : F;
| 提出日時 | 2022-08-02 22:56:39 | 
|---|---|
| 問題 | If | 
| ユーザー | yotarotsukada | 
| ステータス | Wrong Answer | 
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<If<true, 'a', 'b'>, 'a'>>, Expect<Equal<If<false, 'a', 2>, 2>>, ] // @ts-expect-error type error = If<null, 'a', 'b'>