[vala] Report error when overriding method with static method



commit 37f9e472bf975e541988e94e6c70fde8646c749c
Author: Jürg Billeter <j bitron ch>
Date:   Sun Aug 2 19:51:34 2009 +0200

    Report error when overriding method with static method

 vala/valamethod.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 88d4e21..bd3a5da 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -421,6 +421,11 @@ public class Vala.Method : Member {
 	 * @return true if the specified method is compatible to this method
 	 */
 	public bool compatible (Method base_method, out string? invalid_match) {
+		if (binding != base_method.binding) {
+			invalid_match = "incompatible binding";
+			return false;
+		}
+
 		ObjectType object_type = null;
 		if (parent_symbol is ObjectTypeSymbol) {
 			object_type = new ObjectType ((ObjectTypeSymbol) parent_symbol);



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