@@ -35,15 +35,15 @@ function fcn( x: number, y: number, z: number ): number {
35
35
36
36
// The function returns undefined...
37
37
{
38
- const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
39
- const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
40
- const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
41
- const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
38
+ const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
39
+ const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
40
+ const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
41
+ const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
42
42
43
43
const shapes : [ Array < number > , Array < number > , Array < number > , Array < number > ] = [ [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] ] ;
44
44
45
45
bternary3d ( [ x , y , z , out ] , shapes , fcn ) ; // $ExpectType void
46
- bternary3d ( [ x [ 0 ] [ 0 ] , y , z , out ] , [ shapes [ 0 ] [ 2 ] , shapes [ 1 ] , shapes [ 2 ] , shapes [ 3 ] ] , fcn ) ; // $ExpectType void
46
+ bternary3d ( [ x [ 0 ] [ 0 ] , y , z , out ] , [ [ shapes [ 0 ] [ 2 ] ] , shapes [ 1 ] , shapes [ 2 ] , shapes [ 3 ] ] , fcn ) ; // $ExpectType void
47
47
}
48
48
49
49
// The compiler throws an error if the function is provided a first argument which is not an array of nested arrays...
@@ -62,10 +62,10 @@ function fcn( x: number, y: number, z: number ): number {
62
62
63
63
// The compiler throws an error if the function is provided a second argument which is not an array of arrays...
64
64
{
65
- const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
66
- const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
67
- const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
68
- const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
65
+ const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
66
+ const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
67
+ const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
68
+ const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
69
69
70
70
bternary3d ( [ x , y , z , out ] , 'abc' , fcn ) ; // $ExpectError
71
71
bternary3d ( [ x , y , z , out ] , 3.14 , fcn ) ; // $ExpectError
@@ -79,10 +79,10 @@ function fcn( x: number, y: number, z: number ): number {
79
79
80
80
// The compiler throws an error if the function is provided a third argument which is not a valid callback...
81
81
{
82
- const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
83
- const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
84
- const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
85
- const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
82
+ const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
83
+ const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
84
+ const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
85
+ const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
86
86
87
87
const shapes : [ Array < number > , Array < number > , Array < number > , Array < number > ] = [ [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] ] ;
88
88
@@ -97,10 +97,10 @@ function fcn( x: number, y: number, z: number ): number {
97
97
98
98
// The compiler throws an error if the function is provided an unsupported number of arguments...
99
99
{
100
- const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
101
- const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
102
- const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
103
- const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
100
+ const x = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
101
+ const y = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
102
+ const z = [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ] ;
103
+ const out = [ [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] , [ [ 0.0 , 0.0 ] , [ 0.0 , 0.0 ] ] ] ;
104
104
105
105
const shapes : [ Array < number > , Array < number > , Array < number > , Array < number > ] = [ [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] , [ 2 , 2 , 2 ] ] ;
106
106
0 commit comments