[vala] Fix base class method compatibility check with the ellipsis parameter
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Fix base class method compatibility check with the ellipsis parameter
- Date: Sat, 15 Jan 2011 09:23:48 +0000 (UTC)
commit 51a150aac330b7b96a14e2ac8e4f8fdbf9b0b847
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Jan 10 10:50:48 2011 +0100
Fix base class method compatibility check with the ellipsis parameter
Fixes bug 633218.
vala/valamethod.vala | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index bc301f5..65d062f 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -537,12 +537,19 @@ public class Vala.Method : Subroutine {
invalid_match = "too few parameters";
return false;
}
-
- actual_base_type = base_param.variable_type.get_actual_type (object_type, null, this);
- if (!actual_base_type.equals (method_params_it.get ().variable_type)) {
- invalid_match = "incompatible type of parameter %d".printf (param_index);
+
+ var param = method_params_it.get ();
+ if (base_param.ellipsis != param.ellipsis) {
+ invalid_match = "ellipsis parameter mismatch";
return false;
}
+ if (!base_param.ellipsis) {
+ actual_base_type = base_param.variable_type.get_actual_type (object_type, null, this);
+ if (!actual_base_type.equals (param.variable_type)) {
+ invalid_match = "incompatible type of parameter %d".printf (param_index);
+ return false;
+ }
+ }
param_index++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]