diff --git a/tests/Makefile.am b/tests/Makefile.am
index f7efca8..0db7170 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -231,6 +231,7 @@ TESTS = \
 	asynchronous/bug661961.vala \
 	asynchronous/bug742621.vala \
 	asynchronous/bug762819.vala \
+	asynchronous/bug777242.vala \
 	asynchronous/closures.vala \
 	asynchronous/generator.vala \
 	asynchronous/yield.vala \
diff --git a/tests/asynchronous/bug777242.vala b/tests/asynchronous/bug777242.vala
new file mode 100644
index 0000000..f727491
--- /dev/null
+++ b/tests/asynchronous/bug777242.vala
@@ -0,0 +1,40 @@
+void main() {
+	var loop = new MainLoop ();
+	Idle.add (() => {
+		run.begin (loop);
+		return false;
+	});
+	loop.run ();
+}
+
+static int count = 0;
+
+static async void run (MainLoop loop) {
+	while (true) {
+		try {
+			string header;
+
+			if (count == 0) {
+				header = get_next_header ();
+				print ("%s\n", header);
+			}
+
+			var body = get_next_body ();
+			print ("%s\n", body);
+		} catch (Error e) {
+			break;
+		}
+	}
+
+	loop.quit ();
+}
+
+static string get_next_header () {
+	return "Header #%d".printf (count);
+}
+
+static string get_next_body () throws Error {
+	if (count == 2)
+		throw new IOError.FAILED ("Exhausted");
+	return "Body #%d".printf (count++);
+}
