[vala] method: Always consider compatible with itself
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] method: Always consider compatible with itself
- Date: Mon, 20 Mar 2017 19:58:16 +0000 (UTC)
commit c0ff1adfb3c96c2effddadbae441ab2a81cb0751
Author: Marvin W <git larma de>
Date: Mon Mar 20 18:50:06 2017 +0100
method: Always consider compatible with itself
This is even the case with unresolved types.
https://bugzilla.gnome.org/show_bug.cgi?id=773135
vala/valamethod.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index f79ec7b..8789468 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -307,6 +307,12 @@ public class Vala.Method : Subroutine, Callable {
* @return true if the specified method is compatible to this method
*/
public bool compatible (Method base_method, out string? invalid_match) {
+ // method is always compatible to itself
+ if (this == base_method) {
+ invalid_match = null;
+ return true;
+ }
+
if (binding != base_method.binding) {
invalid_match = "incompatible binding";
return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]