[vala/0.10-parallel: 10/32] UnresolvedType: Improve .to_string()



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

    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]