const type parameters, and the literal that stopped widening

A function taking an array of strings receives string[], losing the literal types, unless the caller writes as const every time.

// before: every call site needs as const
function pick<T extends string[]>(keys: T): T { return keys }
pick(['a', 'b'])              // string[]
pick(['a', 'b'] as const)     // readonly ['a', 'b']

// 5.0
function pick<const T extends readonly string[]>(keys: T): T {
  return keys
}
pick(['a', 'b'])              // readonly ['a', 'b']

Moving the assertion from every call site into the declaration is the whole feature, and it is the difference between an API that is precisely typed and one that is precisely typed if the caller remembers. The constraint has to include readonly or the inferred type does not satisfy it, which is the error everybody hits first.