GNOME Bugzilla – Bug 615305
Template class' method returning template object issues gcc warning
Last modified: 2018-05-22 13:32:44 UTC
Testcase: //------------------------------------------- public class TmplClass<K> { public K[]? obj; public K[]? get_obj() { return obj; } } void main() { TmplClass<int> test = new TmplClass<int>(); int[] a; a = test.get_obj(); } //------------------------------------------- Result of compilation: /tmp/test.vala.c: In function '_vala_main': /tmp/test.vala.c:280: warning: assignment from incompatible pointer type Cause of bug: This bug is caused by translating method TmplClass.get_obj() to returning gpointer* in C, but this gpointer* is not being cast to int** where this method is being called on object of template type TmplClass<int>. Other effects: This bug does not make code broken. It only issues not needed warning.
-- 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/85.