@@ -113,59 +113,103 @@ function fcn( v: number ): number {
113113 const x = [ 1 , 2 , 3 ] ;
114114 const y = [ 0 , 0 , 0 ] ;
115115
116- map . assign ( x , y , fcn ) ; // $ExpectType Collection<number>
117- map . assign ( new Float64Array ( x ) , new Float64Array ( y ) , fcn ) ; // $ExpectType Collection<number>
118- map . assign ( new Float32Array ( x ) , new Float32Array ( y ) , fcn ) ; // $ExpectType Collection<number>
119- map . assign ( new Int32Array ( x ) , new Int32Array ( y ) , fcn ) ; // $ExpectType Collection<number>
120- map . assign ( new Int16Array ( x ) , new Int16Array ( y ) , fcn ) ; // $ExpectType Collection<number>
121- map . assign ( new Int8Array ( x ) , new Int8Array ( y ) , fcn ) ; // $ExpectType Collection<number>
122- map . assign ( new Uint32Array ( x ) , new Uint32Array ( y ) , fcn ) ; // $ExpectType Collection<number>
123- map . assign ( new Uint16Array ( x ) , new Uint16Array ( y ) , fcn ) ; // $ExpectType Collection<number>
124- map . assign ( new Uint8Array ( x ) , new Uint8Array ( y ) , fcn ) ; // $ExpectType Collection<number>
125- map . assign ( new Uint8ClampedArray ( x ) , new Uint8ClampedArray ( y ) , fcn ) ; // $ExpectType Collection<number>
126- map . assign ( toAccessorArray ( x ) , toAccessorArray ( y ) , fcn ) ; // $ExpectType AccessorArrayLike<number>
127-
128- map . assign ( x , y , fcn , { } ) ; // $ExpectType Collection<number>
129- map . assign ( new Float64Array ( x ) , new Float64Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
130- map . assign ( new Float32Array ( x ) , new Float32Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
131- map . assign ( new Int32Array ( x ) , new Int32Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
132- map . assign ( new Int16Array ( x ) , new Int16Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
133- map . assign ( new Int8Array ( x ) , new Int8Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
134- map . assign ( new Uint32Array ( x ) , new Uint32Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
135- map . assign ( new Uint16Array ( x ) , new Uint16Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
136- map . assign ( new Uint8Array ( x ) , new Uint8Array ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
137- map . assign ( new Uint8ClampedArray ( x ) , new Uint8ClampedArray ( y ) , fcn , { } ) ; // $ExpectType Collection<number>
138- map . assign ( toAccessorArray ( x ) , toAccessorArray ( y ) , fcn , { } ) ; // $ExpectType AccessorArrayLike<number>
116+ map . assign ( x , y , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
117+ map . assign ( new Float64Array ( x ) , new Float64Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
118+ map . assign ( new Float32Array ( x ) , new Float32Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
119+ map . assign ( new Int32Array ( x ) , new Int32Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
120+ map . assign ( new Int16Array ( x ) , new Int16Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
121+ map . assign ( new Int8Array ( x ) , new Int8Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
122+ map . assign ( new Uint32Array ( x ) , new Uint32Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
123+ map . assign ( new Uint16Array ( x ) , new Uint16Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
124+ map . assign ( new Uint8Array ( x ) , new Uint8Array ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
125+ map . assign ( new Uint8ClampedArray ( x ) , new Uint8ClampedArray ( y ) , 1 , 0 , fcn ) ; // $ExpectType Collection<number>
126+ map . assign ( toAccessorArray ( x ) , toAccessorArray ( y ) , 1 , 0 , fcn ) ; // $ExpectType AccessorArrayLike<number>
127+
128+ map . assign ( x , y , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
129+ map . assign ( new Float64Array ( x ) , new Float64Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
130+ map . assign ( new Float32Array ( x ) , new Float32Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
131+ map . assign ( new Int32Array ( x ) , new Int32Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
132+ map . assign ( new Int16Array ( x ) , new Int16Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
133+ map . assign ( new Int8Array ( x ) , new Int8Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
134+ map . assign ( new Uint32Array ( x ) , new Uint32Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
135+ map . assign ( new Uint16Array ( x ) , new Uint16Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
136+ map . assign ( new Uint8Array ( x ) , new Uint8Array ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
137+ map . assign ( new Uint8ClampedArray ( x ) , new Uint8ClampedArray ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType Collection<number>
138+ map . assign ( toAccessorArray ( x ) , toAccessorArray ( y ) , 1 , 0 , fcn , { } ) ; // $ExpectType AccessorArrayLike<number>
139139}
140140
141141// The compiler throws an error if the `assign` method is provided a first argument which is not a collection...
142142{
143143 const y = [ 0 , 0 , 0 ] ;
144144
145- map . assign ( 2 , y , fcn ) ; // $ExpectError
146- map . assign ( false , y , fcn ) ; // $ExpectError
147- map . assign ( true , y , fcn ) ; // $ExpectError
148- map . assign ( { } , y , fcn ) ; // $ExpectError
145+ map . assign ( 2 , y , 1 , 0 , fcn ) ; // $ExpectError
146+ map . assign ( false , y , 1 , 0 , fcn ) ; // $ExpectError
147+ map . assign ( true , y , 1 , 0 , fcn ) ; // $ExpectError
148+ map . assign ( { } , y , 1 , 0 , fcn ) ; // $ExpectError
149149
150- map . assign ( 2 , y , fcn , { } ) ; // $ExpectError
151- map . assign ( false , y , fcn , { } ) ; // $ExpectError
152- map . assign ( true , y , fcn , { } ) ; // $ExpectError
153- map . assign ( { } , y , fcn , { } ) ; // $ExpectError
150+ map . assign ( 2 , y , 1 , 0 , fcn , { } ) ; // $ExpectError
151+ map . assign ( false , y , 1 , 0 , fcn , { } ) ; // $ExpectError
152+ map . assign ( true , y , 1 , 0 , fcn , { } ) ; // $ExpectError
153+ map . assign ( { } , y , 1 , 0 , fcn , { } ) ; // $ExpectError
154154}
155155
156- // The compiler throws an error if the `assign` method is provided a second argument which is not a function ...
156+ // The compiler throws an error if the `assign` method is provided a second argument which is not a collection ...
157157{
158158 const x = [ 1 , 2 , 3 ] ;
159159
160- map . assign ( x , 2 ) ; // $ExpectError
161- map . assign ( x , false ) ; // $ExpectError
162- map . assign ( x , true ) ; // $ExpectError
163- map . assign ( x , { } ) ; // $ExpectError
160+ map . assign ( x , 2 , 1 , 0 , fcn ) ; // $ExpectError
161+ map . assign ( x , false , 1 , 0 , fcn ) ; // $ExpectError
162+ map . assign ( x , true , 1 , 0 , fcn ) ; // $ExpectError
163+ map . assign ( x , { } , 1 , 0 , fcn ) ; // $ExpectError
164164
165- map . assign ( x , 2 , { } ) ; // $ExpectError
166- map . assign ( x , false , { } ) ; // $ExpectError
167- map . assign ( x , true , { } ) ; // $ExpectError
168- map . assign ( x , { } , { } ) ; // $ExpectError
165+ map . assign ( x , 2 , 1 , 0 , fcn , { } ) ; // $ExpectError
166+ map . assign ( x , false , 1 , 0 , fcn , { } ) ; // $ExpectError
167+ map . assign ( x , true , 1 , 0 , fcn , { } ) ; // $ExpectError
168+ map . assign ( x , { } , 1 , 0 , fcn , { } ) ; // $ExpectError
169+ }
170+
171+ // The compiler throws an error if the `assign` method is provided a third argument which is not a number...
172+ {
173+ const x = [ 1 , 2 , 3 ] ;
174+ const y = [ 0 , 0 , 0 ] ;
175+
176+ map . assign ( x , y , false , 0 , fcn ) ; // $ExpectError
177+ map . assign ( x , y , true , 0 , fcn ) ; // $ExpectError
178+ map . assign ( x , y , { } , 0 , fcn ) ; // $ExpectError
179+
180+ map . assign ( x , y , false , 0 , fcn , { } ) ; // $ExpectError
181+ map . assign ( x , y , true , 0 , fcn , { } ) ; // $ExpectError
182+ map . assign ( x , y , { } , 0 , fcn , { } ) ; // $ExpectError
183+ }
184+
185+ // The compiler throws an error if the `assign` method is provided a fourth argument which is not a number...
186+ {
187+ const x = [ 1 , 2 , 3 ] ;
188+ const y = [ 0 , 0 , 0 ] ;
189+
190+ map . assign ( x , y , 1 , false , fcn ) ; // $ExpectError
191+ map . assign ( x , y , 1 , true , fcn ) ; // $ExpectError
192+ map . assign ( x , y , 1 , { } , fcn ) ; // $ExpectError
193+
194+ map . assign ( x , y , 1 , false , fcn , { } ) ; // $ExpectError
195+ map . assign ( x , y , 1 , true , fcn , { } ) ; // $ExpectError
196+ map . assign ( x , y , 1 , { } , fcn , { } ) ; // $ExpectError
197+ }
198+
199+ // The compiler throws an error if the `assign` method is provided a fifth argument which is not a function...
200+ {
201+ const x = [ 1 , 2 , 3 ] ;
202+ const y = [ 0 , 0 , 0 ] ;
203+
204+ map . assign ( x , y , 1 , 0 , 2 ) ; // $ExpectError
205+ map . assign ( x , y , 1 , 0 , false ) ; // $ExpectError
206+ map . assign ( x , y , 1 , 0 , true ) ; // $ExpectError
207+ map . assign ( x , y , 1 , 0 , { } ) ; // $ExpectError
208+
209+ map . assign ( x , y , 1 , 0 , 2 , { } ) ; // $ExpectError
210+ map . assign ( x , y , 1 , 0 , false , { } ) ; // $ExpectError
211+ map . assign ( x , y , 1 , 0 , true , { } ) ; // $ExpectError
212+ map . assign ( x , y , 1 , 0 , { } , { } ) ; // $ExpectError
169213}
170214
171215// The compiler throws an error if the `assign` method is provided an unsupported number of arguments...
@@ -176,5 +220,6 @@ function fcn( v: number ): number {
176220 map . assign ( ) ; // $ExpectError
177221 map . assign ( x ) ; // $ExpectError
178222 map . assign ( x , y ) ; // $ExpectError
179- map . assign ( x , y , fcn , { } , { } ) ; // $ExpectError
223+ map . assign ( x , y , 1 , 0 ) ; // $ExpectError
224+ map . assign ( x , y , 1 , 0 , fcn , { } , { } ) ; // $ExpectError
180225}
0 commit comments