| ... | @@ -190,16 +190,16 @@ fn testTryToTrickEvalWithRuntimeIf(b: bool) usize { | ... | @@ -190,16 +190,16 @@ fn testTryToTrickEvalWithRuntimeIf(b: bool) usize { |
| 190 | } | 190 | } |
| 191 | } | 191 | } |
| 192 | | 192 | |
| 193 | //test "inlined loop has array literal with elided runtime scope on first iteration but not second iteration" { | 193 | test "inlined loop has array literal with elided runtime scope on first iteration but not second iteration" { |
| 194 | // var runtime = [1]i32{3}; | 194 | var runtime = [1]i32{3}; |
| 195 | // comptime var i: usize = 0; | 195 | comptime var i: usize = 0; |
| 196 | // inline while (i < 2) : (i += 1) { | 196 | inline while (i < 2) : (i += 1) { |
| 197 | // const result = if (i == 0) [1]i32{2} else runtime; | 197 | const result = if (i == 0) [1]i32{2} else runtime; |
| 198 | // } | 198 | } |
| 199 | // comptime { | 199 | comptime { |
| 200 | // expect(i == 2); | 200 | expect(i == 2); |
| 201 | // } | 201 | } |
| 202 | //} | 202 | } |
| 203 | | 203 | |
| 204 | fn max(comptime T: type, a: T, b: T) T { | 204 | fn max(comptime T: type, a: T, b: T) T { |
| 205 | if (T == bool) { | 205 | if (T == bool) { |
| ... | @@ -668,9 +668,9 @@ fn loopNTimes(comptime n: usize) void { | ... | @@ -668,9 +668,9 @@ fn loopNTimes(comptime n: usize) void { |
| 668 | inline while (i < n) : (i += 1) {} | 668 | inline while (i < n) : (i += 1) {} |
| 669 | } | 669 | } |
| 670 | | 670 | |
| 671 | //test "variable inside inline loop that has different types on different iterations" { | 671 | test "variable inside inline loop that has different types on different iterations" { |
| 672 | // testVarInsideInlineLoop(true, u32(42)); | 672 | testVarInsideInlineLoop(true, u32(42)); |
| 673 | //} | 673 | } |
| 674 | | 674 | |
| 675 | fn testVarInsideInlineLoop(args: ...) void { | 675 | fn testVarInsideInlineLoop(args: ...) void { |
| 676 | comptime var i = 0; | 676 | comptime var i = 0; |
| ... | @@ -681,14 +681,14 @@ fn testVarInsideInlineLoop(args: ...) void { | ... | @@ -681,14 +681,14 @@ fn testVarInsideInlineLoop(args: ...) void { |
| 681 | } | 681 | } |
| 682 | } | 682 | } |
| 683 | | 683 | |
| 684 | //test "inline for with same type but different values" { | 684 | test "inline for with same type but different values" { |
| 685 | // var res: usize = 0; | 685 | var res: usize = 0; |
| 686 | // inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { | 686 | inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { |
| 687 | // var a: T = undefined; | 687 | var a: T = undefined; |
| 688 | // res += a.len; | 688 | res += a.len; |
| 689 | // } | 689 | } |
| 690 | // expect(res == 5); | 690 | expect(res == 5); |
| 691 | //} | 691 | } |
| 692 | | 692 | |
| 693 | test "refer to the type of a generic function" { | 693 | test "refer to the type of a generic function" { |
| 694 | const Func = fn (type) void; | 694 | const Func = fn (type) void; |