@@ -43,21 +43,6 @@ import some = require( './index' );
4343 some ( x , n , { 'dims' : [ 0 ] } ) ; // $ExpectType boolndarray
4444}
4545
46- // The function has an `assign` method which returns an ndarray...
47- {
48- const x = zeros ( [ 2 , 2 ] ) ;
49- const n = zeros ( [ ] , {
50- 'dtype' : 'int32'
51- } ) ;
52- const y = empty ( [ ] , { 'dtype' : 'bool' } ) ;
53-
54- some . assign ( x , 2 , y ) ; // $ExpectType ndarray
55- some . assign ( x , 2 , y , { 'dims' : [ 0 ] } ) ; // $ExpectType ndarray
56-
57- some . assign ( x , n , y ) ; // $ExpectType ndarray
58- some . assign ( x , n , y , { 'dims' : [ 0 ] } ) ; // $ExpectType ndarray
59- }
60-
6146// The compiler throws an error if the function is provided a first argument which is not an ndarray...
6247{
6348 some ( 5 , 2 ) ; // $ExpectError
@@ -79,7 +64,7 @@ import some = require( './index' );
7964 some ( ( x : number ) : number => x , 2 , { } ) ; // $ExpectError
8065}
8166
82- // The compiler throws an error if the function is provided a second argument which is not an integer ndarray or a number...
67+ // The compiler throws an error if the function is provided a second argument which is not an ndarray or a number...
8368{
8469 const x = zeros ( [ 2 , 2 ] ) ;
8570
@@ -200,27 +185,47 @@ import some = require( './index' );
200185 some . assign ( undefined , 2 , y ) ; // $ExpectError
201186 some . assign ( { } , 2 , y ) ; // $ExpectError
202187 some . assign ( [ 1 ] , 2 , y ) ; // $ExpectError
203- some . assign ( ( x : number ) : number => x , 2 , y ) ; // $ExpectError
188+
189+ some . assign ( 5 , 2 , y , { } ) ; // $ExpectError
190+ some . assign ( true , 2 , y , { } ) ; // $ExpectError
191+ some . assign ( false , 2 , y , { } ) ; // $ExpectError
192+ some . assign ( null , 2 , y , { } ) ; // $ExpectError
193+ some . assign ( undefined , 2 , y , { } ) ; // $ExpectError
194+ some . assign ( { } , 2 , y , { } ) ; // $ExpectError
195+ some . assign ( [ 1 ] , 2 , y , { } ) ; // $ExpectError
196+ some . assign ( ( x : number ) : number => x , 2 , y , { } ) ; // $ExpectError
197+ some . assign ( ( x : number ) : number => x , 2 , y , { } ) ; // $ExpectError
204198}
205199
206- // The compiler throws an error if the `assign` method is provided a second argument which is not an integer ndarray or a number...
200+ // The compiler throws an error if the `assign` method is provided a second argument which is not an ndarray or a number...
207201{
208202 const x = zeros ( [ 2 , 2 ] ) ;
209203 const y = empty ( [ ] ) ;
210204
205+ some . assign ( x , '5' , y ) ; // $ExpectError
211206 some . assign ( x , true , y ) ; // $ExpectError
212207 some . assign ( x , false , y ) ; // $ExpectError
213208 some . assign ( x , null , y ) ; // $ExpectError
214209 some . assign ( x , undefined , y ) ; // $ExpectError
215210 some . assign ( x , [ ] , y ) ; // $ExpectError
216211 some . assign ( x , { } , y ) ; // $ExpectError
217212 some . assign ( x , ( x : number ) : number => x , y ) ; // $ExpectError
213+
214+ some . assign ( x , '5' , y , { } ) ; // $ExpectError
215+ some . assign ( x , true , y , { } ) ; // $ExpectError
216+ some . assign ( x , false , y , { } ) ; // $ExpectError
217+ some . assign ( x , null , y , { } ) ; // $ExpectError
218+ some . assign ( x , undefined , y , { } ) ; // $ExpectError
219+ some . assign ( x , [ ] , y , { } ) ; // $ExpectError
220+ some . assign ( x , { } , y , { } ) ; // $ExpectError
221+ some . assign ( x , ( x : number ) : number => x , y , { } ) ; // $ExpectError
218222}
219223
220224// The compiler throws an error if the `assign` method is provided a third argument which is not an ndarray...
221225{
222226 const x = zeros ( [ 2 , 2 ] ) ;
223227
228+ some . assign ( x , 2 , '5' ) ; // $ExpectError
224229 some . assign ( x , 2 , 5 ) ; // $ExpectError
225230 some . assign ( x , 2 , true ) ; // $ExpectError
226231 some . assign ( x , 2 , false ) ; // $ExpectError
@@ -229,6 +234,16 @@ import some = require( './index' );
229234 some . assign ( x , 2 , { } ) ; // $ExpectError
230235 some . assign ( x , 2 , [ 1 ] ) ; // $ExpectError
231236 some . assign ( x , 2 , ( x : number ) : number => x ) ; // $ExpectError
237+
238+ some . assign ( x , 2 , '5' , { } ) ; // $ExpectError
239+ some . assign ( x , 2 , 5 , { } ) ; // $ExpectError
240+ some . assign ( x , 2 , true , { } ) ; // $ExpectError
241+ some . assign ( x , 2 , false , { } ) ; // $ExpectError
242+ some . assign ( x , 2 , null , { } ) ; // $ExpectError
243+ some . assign ( x , 2 , undefined , { } ) ; // $ExpectError
244+ some . assign ( x , 2 , { } , { } ) ; // $ExpectError
245+ some . assign ( x , 2 , [ 1 ] , { } ) ; // $ExpectError
246+ some . assign ( x , 2 , ( x : number ) : number => x , { } ) ; // $ExpectError
232247}
233248
234249// The compiler throws an error if the `assign` method is provided an options argument which is not an object...
0 commit comments