diff options
Diffstat (limited to 'giscanner/docwriter.py')
-rw-r--r-- | giscanner/docwriter.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py index 37f575b7..40c5fbed 100644 --- a/giscanner/docwriter.py +++ b/giscanner/docwriter.py @@ -673,7 +673,10 @@ class DocFormatterGjs(DocFormatterIntrospectableBase): return fundamental_types.get(name, name) def format_type(self, type_, link=False): - if isinstance(type_, (ast.List, ast.Array)): + if isinstance(type_, ast.Array) and \ + type_.element_type.target_fundamental in ('gint8', 'guint8'): + return 'ByteArray' + elif isinstance(type_, (ast.List, ast.Array)): return 'Array(' + self.format_type(type_.element_type, link) + ')' elif isinstance(type_, ast.Map): return '{%s: %s}' % (self.format_type(type_.key_type, link), @@ -682,6 +685,8 @@ class DocFormatterGjs(DocFormatterIntrospectableBase): return "void" elif type_.target_giname is not None: giname = type_.target_giname + if giname in ('GLib.ByteArray', 'GLib.Bytes'): + return 'ByteArray' if link: nsname = self._transformer.namespace.name if giname.startswith(nsname + '.'): |