summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-10 13:59:04 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-10 14:00:27 +0000
commitc29b1e356a47212b61aae5476f9b058379474f07 (patch)
treedd772e7ac3d465e93d74161d7694a023c243cc46 /tools
parente37c5871ef6c4ed254e2b6ec046eb5afe20dce93 (diff)
specparser: complain if tp:mapping's specified type is a lie
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/specparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/specparser.py b/tools/specparser.py
index be0d499a..3ad1f9a3 100644
--- a/tools/specparser.py
+++ b/tools/specparser.py
@@ -1057,6 +1057,13 @@ class Mapping(StructLike):
# rewrite the D-Bus type
self.dbus_type = 'a{%s}' % ''.join(map(lambda m: m.dbus_type, self.members))
+ # not sure why tp:mapping sometimes has a type attribute, but
+ # make sure it's right.
+ t = dom.getAttribute('type')
+ if t and self.dbus_type != t:
+ raise TypeMismatch('%r reports type is %s but actual type is %s'
+ % (self, t, self.dbus_type))
+
class Struct(StructLike):
devhelp_name = "struct"