[vala] Check parameter directions in inherited methods
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Check parameter directions in inherited methods
- Date: Fri, 29 Mar 2013 20:32:27 +0000 (UTC)
commit 00673f24ce975196cf1c2b01c8ca1bef8c946658
Author: Simon Werbeck <simon werbeck gmail com>
Date: Fri Mar 29 03:12:38 2013 +0100
Check parameter directions in inherited methods
Fixes bug 695214.
vala/valamethod.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 7af50e8..cf02d60 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -327,6 +327,11 @@ public class Vala.Method : Subroutine {
return false;
}
if (!base_param.ellipsis) {
+ if (base_param.direction != param.direction) {
+ invalid_match = "incompatible direction of parameter %d".printf
(param_index);
+ return false;
+ }
+
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]