summaryrefslogtreecommitdiff
path: root/giscanner/introspectablepass.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-01 17:55:30 -0400
committerColin Walters <walters@verbum.org>2010-09-01 17:55:30 -0400
commitf9db355f2f1f55307e32e0f9f2d787f46941681b (patch)
treeaed47efe287c73eb9ee78914b9942267a74a1197 /giscanner/introspectablepass.py
parentfb6979ec7555bba02ebf80cb8756ae274759ac8e (diff)
downloadgobject-introspection-f9db355f2f1f55307e32e0f9f2d787f46941681b.tar.gz
scanner: Better handling of GType names
Before, Type instances could be indeterminate, holding a "ctype", which means "This is some unresolved string". However, we also get data from GType, so add gtype_name as another indeterminate state. Clean up how we create and resolve Type instances from GType data.
Diffstat (limited to 'giscanner/introspectablepass.py')
-rw-r--r--giscanner/introspectablepass.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index f3ab7e65..78434116 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -64,7 +64,8 @@ class IntrospectablePass(object):
target = None
if not node.type.resolved:
- self._parameter_warning(parent, node, "Unresolved ctype: %r" % (node.type.ctype, ))
+ self._parameter_warning(parent, node,
+"Unresolved type: %r" % (node.type.unresolved_string, ))
parent.introspectable = False
return
@@ -113,6 +114,8 @@ class IntrospectablePass(object):
def _type_is_introspectable(self, typeval, warn=False):
if not typeval.resolved:
return False
+ if isinstance(typeval, ast.TypeUnknown):
+ return False
if isinstance(typeval, (ast.Array, ast.List)):
return self._type_is_introspectable(typeval.element_type)
elif isinstance(typeval, ast.Map):