Ensure constructor returns are always most concrete type
authorColin Walters <walters@src.gnome.org>
Sun, 28 Sep 2008 04:05:29 +0000 (04:05 +0000)
committerColin Walters <walters@src.gnome.org>
Sun, 28 Sep 2008 04:05:29 +0000 (04:05 +0000)
This makes things a bit easier for binding writers - the
superclass returns are only a C convenience.

svn path=/trunk/; revision=632

giscanner/glibtransformer.py

index f007e33..40608f8 100644 (file)
@@ -378,6 +378,9 @@ class GLibTransformer(object):
                 return None
             # TODO - check that the return type is a subclass of the
             # class from the prefix
+            # But for now, ensure that constructor returns are always
+            # the most concrete class
+            func.retval.type = Type(klass.name, klass.ctype+'*')
 
         self._remove_attribute(func.name)
         # Strip namespace and object prefix: gtk_window_new -> new