[vala/parallel: 3/12] Vala.UnresolvedType: Improve .to_string()



commit c15b3928a6cd42823fd0bc90954a8edea6e9976d
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Aug 24 19:24:58 2010 +0200

    Vala.UnresolvedType: Improve .to_string()
    
    Include nullable designation and generic type arguments in the output.

 vala/valaunresolvedtype.vala |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaunresolvedtype.vala b/vala/valaunresolvedtype.vala
index f9355f6..201fd61 100644
--- a/vala/valaunresolvedtype.vala
+++ b/vala/valaunresolvedtype.vala
@@ -87,6 +87,29 @@ public class Vala.UnresolvedType : DataType {
 	}
 
 	public override string to_qualified_string (Scope? scope) {
-		return unresolved_symbol.to_string ();
+		var s = unresolved_symbol.to_string ();
+
+		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.value_owned) {
+					s += "weak ";
+				}
+				s += type_arg.to_qualified_string (scope);
+			}
+			s += ">";
+		}
+		if (nullable) {
+			s += "?";
+		}
+
+		return s;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]