Commit 31bd6527 authored by Allison Karlitskaya's avatar Allison Karlitskaya Committed by Jürg Billeter

Write delegates as qualified types in code writer

Fixes bug 643927.
parent f197d733
...@@ -171,6 +171,8 @@ public abstract class Vala.DataType : CodeNode { ...@@ -171,6 +171,8 @@ public abstract class Vala.DataType : CodeNode {
} }
public virtual string to_qualified_string (Scope? scope = null) { public virtual string to_qualified_string (Scope? scope = null) {
// logic temporarily duplicated in DelegateType class
string s; string s;
if (data_type != null) { if (data_type != null) {
......
...@@ -47,7 +47,27 @@ public class Vala.DelegateType : DataType { ...@@ -47,7 +47,27 @@ public class Vala.DelegateType : DataType {
} }
public override string to_qualified_string (Scope? scope) { public override string to_qualified_string (Scope? scope) {
string s = delegate_symbol.get_full_name (); // logic temporarily duplicated from DataType class
Symbol global_symbol = delegate_symbol;
while (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 (); var type_args = get_type_arguments ();
if (type_args.size > 0) { if (type_args.size > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment