summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2014-07-28 17:54:14 -0400
committerColin Walters <walters@verbum.org>2014-09-05 18:49:22 -0400
commitbce199127da5368700f3105e0bd19bc338810915 (patch)
treedeb2f4889590a3a575d068c566e79e5a5ff942a5 /giscanner/maintransformer.py
parent9b2effedf08c5842f9ac49896875e5df1f63db4d (diff)
downloadgobject-introspection-bce199127da5368700f3105e0bd19bc338810915.tar.gz
scanner: Honor nested types on array declarations as well
We have special code to look at (type GLib.List(utf8)), but (type GLib.PtrArray(utf8)) didn't work. This allows NetworkManager to annotate the ActiveConnections property. https://bugzilla.gnome.org/show_bug.cgi?id=733879
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 19e3f24c..4326374f 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -287,7 +287,10 @@ class MainTransformer(object):
return base
if isinstance(base, ast.List) and len(rest) == 1:
return ast.List(base.name, *rest)
- if isinstance(base, ast.Map) and len(rest) == 2:
+ elif isinstance(base, ast.Array) and len(rest) == 1:
+ base.element_type = rest[0]
+ return base
+ elif isinstance(base, ast.Map) and len(rest) == 2:
return ast.Map(*rest)
message.warn(
"Too many parameters in type specification %r" % (type_str, ))