@@ -348,11 +348,7 @@ export const anonTestFunctionType = "(s: string) => string";
348348export const selfTestFunctionType = "(this: any, s: string) => string" ;
349349export const noSelfTestFunctionType = "(this: void, s: string) => string" ;
350350
351- type TestFunctionCast = [
352- /*testFunction: */ TestFunction ,
353- /*castedFunction: */ string ,
354- /*isSelfConversion?: */ boolean ?
355- ] ;
351+ type TestFunctionCast = [ TestFunction , string ] ;
356352export const validTestFunctionCasts : TestFunctionCast [ ] = [
357353 [ selfTestFunctions [ 0 ] , `<${ anonTestFunctionType } >(${ selfTestFunctions [ 0 ] . value } )` ] ,
358354 [ selfTestFunctions [ 0 ] , `(${ selfTestFunctions [ 0 ] . value } ) as (${ anonTestFunctionType } )` ] ,
@@ -366,21 +362,17 @@ export const validTestFunctionCasts: TestFunctionCast[] = [
366362 [ noSelfInFileTestFunctions [ 0 ] , `(${ noSelfInFileTestFunctions [ 0 ] . value } ) as (${ noSelfTestFunctionType } )` ] ,
367363] ;
368364export const invalidTestFunctionCasts : TestFunctionCast [ ] = [
369- [ noSelfTestFunctions [ 0 ] , `<${ anonTestFunctionType } >(${ noSelfTestFunctions [ 0 ] . value } )` , false ] ,
370- [ noSelfTestFunctions [ 0 ] , `(${ noSelfTestFunctions [ 0 ] . value } ) as (${ anonTestFunctionType } )` , false ] ,
371- [ noSelfTestFunctions [ 0 ] , `<${ selfTestFunctionType } >(${ noSelfTestFunctions [ 0 ] . value } )` , false ] ,
372- [ noSelfTestFunctions [ 0 ] , `(${ noSelfTestFunctions [ 0 ] . value } ) as (${ selfTestFunctionType } )` , false ] ,
373- [ noSelfInFileTestFunctions [ 0 ] , `<${ selfTestFunctionType } >(${ noSelfInFileTestFunctions [ 0 ] . value } )` , false ] ,
374- [ noSelfInFileTestFunctions [ 0 ] , `(${ noSelfInFileTestFunctions [ 0 ] . value } ) as (${ selfTestFunctionType } )` , false ] ,
375- [ selfTestFunctions [ 0 ] , `<${ noSelfTestFunctionType } >(${ selfTestFunctions [ 0 ] . value } )` , true ] ,
376- [ selfTestFunctions [ 0 ] , `(${ selfTestFunctions [ 0 ] . value } ) as (${ noSelfTestFunctionType } )` , true ] ,
365+ [ noSelfTestFunctions [ 0 ] , `<${ anonTestFunctionType } >(${ noSelfTestFunctions [ 0 ] . value } )` ] ,
366+ [ noSelfTestFunctions [ 0 ] , `(${ noSelfTestFunctions [ 0 ] . value } ) as (${ anonTestFunctionType } )` ] ,
367+ [ noSelfTestFunctions [ 0 ] , `<${ selfTestFunctionType } >(${ noSelfTestFunctions [ 0 ] . value } )` ] ,
368+ [ noSelfTestFunctions [ 0 ] , `(${ noSelfTestFunctions [ 0 ] . value } ) as (${ selfTestFunctionType } )` ] ,
369+ [ noSelfInFileTestFunctions [ 0 ] , `<${ selfTestFunctionType } >(${ noSelfInFileTestFunctions [ 0 ] . value } )` ] ,
370+ [ noSelfInFileTestFunctions [ 0 ] , `(${ noSelfInFileTestFunctions [ 0 ] . value } ) as (${ selfTestFunctionType } )` ] ,
371+ [ selfTestFunctions [ 0 ] , `<${ noSelfTestFunctionType } >(${ selfTestFunctions [ 0 ] . value } )` ] ,
372+ [ selfTestFunctions [ 0 ] , `(${ selfTestFunctions [ 0 ] . value } ) as (${ noSelfTestFunctionType } )` ] ,
377373] ;
378374
379- export type TestFunctionAssignment = [
380- /*testFunction: */ TestFunction ,
381- /*functionType: */ string ,
382- /*isSelfConversion?: */ boolean ?
383- ] ;
375+ export type TestFunctionAssignment = [ TestFunction , string ] ;
384376export const validTestFunctionAssignments : TestFunctionAssignment [ ] = [
385377 ...selfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , anonTestFunctionType ] ) ,
386378 ...selfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType ] ) ,
@@ -395,11 +387,11 @@ export const validTestFunctionAssignments: TestFunctionAssignment[] = [
395387 ...noSelfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , noSelfTestFunctionType ] ) ,
396388] ;
397389export const invalidTestFunctionAssignments : TestFunctionAssignment [ ] = [
398- ...selfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , noSelfTestFunctionType , false ] ) ,
399- ...noSelfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , anonTestFunctionType , true ] ) ,
400- ...noSelfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType , true ] ) ,
401- ...noSelfInFileTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType , true ] ) ,
402- ...selfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , noSelfTestFunctionType , false ] ) ,
403- ...noSelfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , anonTestFunctionType , true ] ) ,
404- ...noSelfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType , true ] ) ,
390+ ...selfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , noSelfTestFunctionType ] ) ,
391+ ...noSelfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , anonTestFunctionType ] ) ,
392+ ...noSelfTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType ] ) ,
393+ ...noSelfInFileTestFunctions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType ] ) ,
394+ ...selfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , noSelfTestFunctionType ] ) ,
395+ ...noSelfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , anonTestFunctionType ] ) ,
396+ ...noSelfTestFunctionExpressions . map ( ( f ) : TestFunctionAssignment => [ f , selfTestFunctionType ] ) ,
405397] ;
0 commit comments