| ... | @@ -740,3 +740,23 @@ test "no reason to resolve frame still works" { | ... | @@ -740,3 +740,23 @@ test "no reason to resolve frame still works" { |
| 740 | fn simpleNothing() void { | 740 | fn simpleNothing() void { |
| 741 | var x: i32 = 1234; | 741 | var x: i32 = 1234; |
| 742 | } | 742 | } |
| | 743 | |
| | 744 | test "async call a generic function" { |
| | 745 | const S = struct { |
| | 746 | fn doTheTest() void { |
| | 747 | var f = async func(i32, 2); |
| | 748 | const result = await f; |
| | 749 | expect(result == 3); |
| | 750 | } |
| | 751 | |
| | 752 | fn func(comptime T: type, inc: T) T { |
| | 753 | var x: T = 1; |
| | 754 | suspend { |
| | 755 | resume @frame(); |
| | 756 | } |
| | 757 | x += inc; |
| | 758 | return x; |
| | 759 | } |
| | 760 | }; |
| | 761 | _ = async S.doTheTest(); |
| | 762 | } |