[vala/staging] vala: Drop DelegateType.to_qualified_string() which is duplicated code
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Drop DelegateType.to_qualified_string() which is duplicated code
- Date: Mon, 30 Sep 2019 14:22:29 +0000 (UTC)
commit 325c81d6f8db52a9172597766930797adfa6f04a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Sep 29 18:52:51 2019 +0200
vala: Drop DelegateType.to_qualified_string() which is duplicated code
and not needed while using DataType.type_symbol for delegate-types too.
vala/valadatatype.vala | 2 --
vala/valadelegatetype.vala | 46 ----------------------------------------------
2 files changed, 48 deletions(-)
---
diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala
index 02cae4d61..2a9b33b1f 100644
--- a/vala/valadatatype.vala
+++ b/vala/valadatatype.vala
@@ -130,8 +130,6 @@ public abstract class Vala.DataType : CodeNode {
}
public virtual string to_qualified_string (Scope? scope = null) {
- // logic temporarily duplicated in DelegateType class
-
string s;
if (type_symbol != null) {
diff --git a/vala/valadelegatetype.vala b/vala/valadelegatetype.vala
index d6a19b481..91b349081 100644
--- a/vala/valadelegatetype.vala
+++ b/vala/valadelegatetype.vala
@@ -39,52 +39,6 @@ public class Vala.DelegateType : CallableType {
this.is_called_once = (delegate_symbol.get_attribute_string ("CCode", "scope") == "async");
}
- public override string to_qualified_string (Scope? scope) {
- // logic temporarily duplicated from DataType class
-
- Symbol global_symbol = delegate_symbol;
- while (global_symbol.parent_symbol != null && global_symbol.parent_symbol.name != null) {
- global_symbol = global_symbol.parent_symbol;
- }
-
- Symbol sym = null;
- Scope parent_scope = scope;
- while (sym == null && parent_scope != null) {
- sym = parent_scope.lookup (global_symbol.name);
- parent_scope = parent_scope.parent_scope;
- }
-
- string s;
-
- if (sym != null && global_symbol != sym) {
- s = "global::" + delegate_symbol.get_full_name ();;
- } else {
- s = delegate_symbol.get_full_name ();
- }
-
- var type_args = get_type_arguments ();
- if (type_args.size > 0) {
- s += "<";
- bool first = true;
- foreach (DataType type_arg in type_args) {
- if (!first) {
- s += ",";
- } else {
- first = false;
- }
- if (type_arg.is_weak ()) {
- s += "weak ";
- }
- s += type_arg.to_qualified_string (scope);
- }
- s += ">";
- }
- if (nullable) {
- s += "?";
- }
- return s;
- }
-
public override DataType copy () {
var result = new DelegateType (delegate_symbol);
result.source_reference = source_reference;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]