[vala/0.10: 37/38] codegen: Fix preconditions in asynchronous methods



commit 5f728c60a39396df162b525cd5354b58e1871abc
Author: Jürg Billeter <j bitron ch>
Date:   Fri Sep 3 16:55:44 2010 +0200

    codegen: Fix preconditions in asynchronous methods

 codegen/valaccodemethodmodule.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 0df172f..4232ab4 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -1010,6 +1010,10 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
 		if (method_node is CreationMethod) {
 			ccheck.call = new CCodeIdentifier ("g_return_val_if_fail");
 			ccheck.add_argument (new CCodeConstant ("NULL"));
+		} else if (method_node is Method && ((Method) method_node).coroutine) {
+			// _co function
+			ccheck.call = new CCodeIdentifier ("g_return_val_if_fail");
+			ccheck.add_argument (new CCodeConstant ("FALSE"));
 		} else if (ret_type is VoidType) {
 			/* void function */
 			ccheck.call = new CCodeIdentifier ("g_return_if_fail");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]