add test for async call of generic function

See #3063
master
Andrew Kelley 2019-08-16 10:54:45 -04:00
parent 5df89dafef
commit 4ea2331e3d
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 20 additions and 0 deletions

View File

@ -740,3 +740,23 @@ test "no reason to resolve frame still works" {
fn simpleNothing() void {
var x: i32 = 1234;
}
test "async call a generic function" {
const S = struct {
fn doTheTest() void {
var f = async func(i32, 2);
const result = await f;
expect(result == 3);
}
fn func(comptime T: type, inc: T) T {
var x: T = 1;
suspend {
resume @frame();
}
x += inc;
return x;
}
};
_ = async S.doTheTest();
}