[vala/0.10] Report error when trying to use async method as delegate



commit 0c0e4492d8e2917b630e06a4b8e828c63b8a9fca
Author: Jürg Billeter <j bitron ch>
Date:   Sat Oct 9 20:56:35 2010 +0200

    Report error when trying to use async method as delegate

 vala/valadelegate.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index 27c660c..af37190 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -157,6 +157,11 @@ public class Vala.Delegate : TypeSymbol {
 	 * @return  true if the specified method is compatible to this callback
 	 */
 	public bool matches_method (Method m, DataType dt) {
+		if (m.coroutine) {
+			// async delegates are not yet supported
+			return false;
+		}
+
 		// method is allowed to ensure stricter return type (stronger postcondition)
 		if (!m.return_type.stricter (return_type.get_actual_type (dt, null, this))) {
 			return false;



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