summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-01-05 21:49:38 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-01-05 22:49:35 +0100
commit9c9b3b4a02c1ad8d0fa198a53ff70ef6ce253dbb (patch)
treec60989f29f2c0b366beeae8ea157dfd4c3f27c6c
parent415b300e01b64ba3515179af43a6a9f031a5dba2 (diff)
downloadvala-9c9b3b4a02c1ad8d0fa198a53ff70ef6ce253dbb.tar.gz
girparser: Let alias inherit more information from base_type
-rw-r--r--vala/valagirparser.vala10
1 files changed, 10 insertions, 0 deletions
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 0c02eef16..5ed041a4f 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3594,6 +3594,7 @@ public class Vala.GirParser : CodeVisitor {
}
cl.comment = alias.comment;
cl.external = true;
+ cl.is_compact = ((Class) type_sym).is_compact;
alias.symbol = cl;
} else if (type_sym is Interface) {
// this is not a correct alias, but what can we do otherwise?
@@ -3632,6 +3633,15 @@ public class Vala.GirParser : CodeVisitor {
alias.symbol = deleg;
}
+
+ // inherit atributes, like type_id
+ if (type_sym is Class || (type_sym is Struct && !simple_type)) {
+ if (type_sym.has_attribute_argument ("CCode", "has_type_id")) {
+ alias.symbol.set_attribute_bool ("CCode", "has_type_id", type_sym.get_attribute_bool ("CCode", "has_type_id"));
+ } else if (type_sym.has_attribute_argument ("CCode", "type_id")) {
+ alias.symbol.set_attribute_string ("CCode", "type_id", type_sym.get_attribute_string ("CCode", "type_id"));
+ }
+ }
}
void process_callable (Node node) {