TypeScript/tests/cases/compiler/arrayConcat3.ts
Nathan Shively-Sanders be0fcd5174
Array.concat now takes ConcatArray, not ReadonlyArray (#21462)
* Overloads in Array.concat now handle ReadonlyArray

Previously it was union types, which is slower.

* Make arrayConcat3 test stricter

* Switch to InputArray instead of adding overloads

* Update baselines

* Update baselines correctly

* Rename to ConcatArray and add slice method

Should make it, respectively, easier to understand this specific type
and harder to satisfy it by mistake.
2018-02-02 13:20:40 -08:00

7 lines
283 B
TypeScript

// @strictFunctionTypes: true
// TODO: remove lib hack when https://github.com/Microsoft/TypeScript/issues/20454 is fixed
type Fn<T extends object> = <U extends T>(subj: U) => U
function doStuff<T extends object, T1 extends T>(a: Array<Fn<T>>, b: Array<Fn<T1>>) {
b.concat(a);
}