@@ -29,16 +29,16 @@ test_type_inference_on_literals_with_default_args :: proc(t: ^testing.T) {
2929 proc_nil :: proc () { }
3030 proc_default_arg :: proc (a: Bit_Set={.A}) -> Bit_Set { return a }
3131 group :: proc {proc_nil, proc_default_arg}
32-
32+
3333 testing.expect_value (t, group (Bit_Set{.A}), Bit_Set{.A})
3434 testing.expect_value (t, group ({.A}), Bit_Set{.A})
3535 }
36- {
36+ {
3737 Bit_Set :: bit_set [enum {A, B, C}]
3838 proc_1 :: proc (a: Bit_Set={.A}) -> int { return 1 }
3939 proc_2 :: proc (a: Bit_Set={.B}, b: Bit_Set={.C}) -> int { return 2 }
4040 group :: proc {proc_1, proc_2}
41-
41+
4242 testing.expect_value (t, group (), 2 )
4343 testing.expect_value (t, group (Bit_Set{.A}), 2 )
4444 testing.expect_value (t, group ({.A}), 2 )
@@ -56,7 +56,7 @@ test_type_inference_on_literals_for_various_types :: proc(t: ^testing.T) {
5656 testing.expect_value (t, group_array ({1.1 , 2.2 , 3.3 }), [3 ]f32 {1.1 , 2.2 , 3.3 })
5757 testing.expect_value (t, group_array ({0 =1.1 , 1 =2.2 , 2 =3.3 }), [3 ]f32 {1.1 , 2.2 , 3.3 })
5858 testing.expect_value (t, group_array ({}), [3 ]f32 {})
59-
59+
6060 proc_slice_u8 :: proc (a: []u8 ) -> []u8 { return a }
6161 group_slice_u8 :: proc {proc_nil, proc_slice_u8}
6262 testing.expect_value (t, len (group_slice_u8 ([]u8 {1 , 2 , 3 })), 3 )
@@ -72,7 +72,7 @@ test_type_inference_on_literals_for_various_types :: proc(t: ^testing.T) {
7272 testing.expect_value (t, len (group_dynamic_array ({0 =1 , 1 =2 , 2 =3 })), 3 )
7373 testing.expect_value (t, len (group_dynamic_array ({})), 0 )
7474 testing.expect_value (t, group_dynamic_array (nil ) == nil , true )
75-
75+
7676 Enum :: enum {A, B, C}
7777 proc_enum :: proc (a: Enum) -> Enum { return a }
7878 group_enum :: proc {proc_nil, proc_enum}
@@ -90,14 +90,14 @@ test_type_inference_on_literals_for_various_types :: proc(t: ^testing.T) {
9090 testing.expect_value (t, group_bit_set (Bit_Set{.A}), Bit_Set{.A})
9191 testing.expect_value (t, group_bit_set ({.A}), Bit_Set{.A})
9292 testing.expect_value (t, group_bit_set ({}), Bit_Set{})
93-
93+
9494 Struct :: struct {a: int , b: int , c: int }
9595 proc_struct :: proc (a: Struct) -> Struct { return a }
9696 group_struct :: proc {proc_nil, proc_struct}
9797 testing.expect_value (t, group_struct (Struct{a = 9 }), Struct{a = 9 })
9898 testing.expect_value (t, group_struct ({a = 9 }), Struct{a = 9 })
9999 testing.expect_value (t, group_struct ({}), Struct{})
100-
100+
101101 Raw_Union :: struct #raw_union {int_: int , f32_: f32 }
102102 proc_raw_union :: proc (a: Raw_Union) -> Raw_Union { return a }
103103 group_raw_union :: proc {proc_nil, proc_raw_union}
@@ -109,8 +109,8 @@ test_type_inference_on_literals_for_various_types :: proc(t: ^testing.T) {
109109 proc_union :: proc (a: Union) -> Union { return a }
110110 group_union :: proc {proc_nil, proc_union}
111111 testing.expect_value (t, group_union (int (9 )).(int ), 9 )
112- testing.expect_value (t, group_union ({}).( int ) , 0 )
113-
112+ testing.expect_value (t, group_union ({}), nil )
113+
114114 proc_map :: proc (a: map [u8 ]u8 ) -> map [u8 ]u8 { return a }
115115 group_map :: proc {proc_nil, proc_map}
116116 testing.expect_value (t, len (group_map (map [u8 ]u8 {1 =1 , 2 =2 })), 2 )
@@ -129,8 +129,8 @@ test_type_inference_on_literals_for_various_types :: proc(t: ^testing.T) {
129129 proc_soa_array :: proc (a: SOA_Array) -> SOA_Array { return a }
130130 group_soa_array :: proc {proc_nil, proc_soa_array}
131131 testing.expect_value (t, len (group_soa_array (SOA_Array{{}, {}})), 2 )
132- testing.expect_value (t, len (group_soa_array ({struct {int , int }{1 , 2 }, struct {int , int }{1 , 2 }})), 1 )
133- testing.expect_value (t, len (group_soa_array ({})), 0 )
132+ testing.expect_value (t, len (group_soa_array ({struct {int , int }{1 , 2 }, struct {int , int }{1 , 2 }})), 2 )
133+ testing.expect_value (t, len (group_soa_array ({})), 2 )
134134 testing.expect_value (t, len (soa_zip (a=[]int {1 , 2 }, b=[]int {3 , 4 })), 2 )
135135
136136 proc_matrix :: proc (a: matrix[2 ,2 ]f32 ) -> matrix[2 ,2 ]f32 { return a }
0 commit comments