Code QuizAdvanced

Unexpected Distribution Over a Union

Naked type parameters in conditional types distribute over unions unless you wrap them in tuples.

Codetypescript
type ToArray<T> = T extends unknown ? T[] : never;

type R = ToArray<string | number>;
// wanted: (string | number)[]
// got:    string[] | number[]

What is the bug in this code?