GNOME Bugzilla – Bug 614097
[ReturnsModifiedPointer] doesn't work well with inheritance
Last modified: 2018-05-22 13:31:13 UTC
public class A { [ReturnsModifiedPointer] public void do_something (); } public class B : A {} A call to B.do_something() now produces the following C code: (A *) b = a_do_something ((A *) b); This obviously doesn't compile. Attached is a patch that makes it compilable at least but a cast is missing now to prevent a compiler warning. Also it feels a bit fragile :)
Created attachment 157276 [details] [review] gstreamer: Don't use the accessor method when accessing Gst.Pad:caps property Gst.Pad.get_caps() returns something completely different than the caps property. Fixes bug #608005.
Created attachment 157277 [details] [review] codegen: Try to fix [ReturnsModifiedPointer] method calls from subclasses
Ping? :) Probably can be closed as obsolete nowadays.
ReturnsModifiedPointer is really not supposed to be used in Vala code--it's only for bindings. We should just emit an error message if someone tries to use it instead of generating invalid C.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/79.