]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Drop DelegateType.to_qualified_string() which is duplicated code
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 29 Sep 2019 16:52:51 +0000 (18:52 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 30 Sep 2019 12:43:00 +0000 (14:43 +0200)
and not needed while using DataType.type_symbol for delegate-types too.

vala/valadatatype.vala
vala/valadelegatetype.vala

index 02cae4d614289b38263fe7955898228bec9696a0..2a9b33b1fb44defd1c1c50e282575f419bdaaa6c 100644 (file)
@@ -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) {
index d6a19b481434fed53206ff70f654cc8a2338fd4b..91b349081b55fbe9450347badbd3f6c479b7d62e 100644 (file)
@@ -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;