From: Ryan Lortie Date: Tue, 24 Aug 2010 17:24:58 +0000 (+0200) Subject: UnresolvedType: Improve .to_string() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2519c034ec9199438769a9fa41c3b40a75a7abd5;p=thirdparty%2Fvala.git UnresolvedType: Improve .to_string() Include nullable designation and generic type arguments in the output. --- diff --git a/vala/valaunresolvedtype.vala b/vala/valaunresolvedtype.vala index f9355f6f1..201fd61d7 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; } }