summaryrefslogtreecommitdiff
path: root/vala/valasymbol.vala
diff options
context:
space:
mode:
Diffstat (limited to 'vala/valasymbol.vala')
-rw-r--r--vala/valasymbol.vala28
1 files changed, 27 insertions, 1 deletions
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 7e8b4493a..ebee414ec 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -508,7 +508,33 @@ public abstract class Vala.Symbol : CodeNode {
}
public override string to_string () {
- return get_full_name ();
+ var builder = new StringBuilder (get_full_name ());
+
+ unowned List<TypeParameter>? type_params = null;
+ if (this is Delegate) {
+ type_params = ((Delegate) this).get_type_parameters ();
+ } else if (this is Method) {
+ type_params = ((Method) this).get_type_parameters ();
+ } else if (this is ObjectTypeSymbol) {
+ type_params = ((ObjectTypeSymbol) this).get_type_parameters ();
+ } else if (this is Struct) {
+ type_params = ((Struct) this).get_type_parameters ();
+ }
+ if (type_params != null && type_params.size > 0) {
+ builder.append_c ('<');
+ bool first = true;
+ foreach (var type_param in type_params) {
+ if (!first) {
+ builder.append_c (',');
+ } else {
+ first = false;
+ }
+ builder.append (type_param.name);
+ }
+ builder.append_c ('>');
+ }
+
+ return builder.str;
}
}