GNOME Bugzilla – Bug 775466
Using a GValue as a generic type when calling a method generates invalid C code
Last modified: 2016-12-10 12:31:19 UTC
I wrote a simple test case to demonstrate this: T test<T> (T param) { return param; } int main (string[] args) { test (4); test (Value (typeof (int))); return 0; } The statement `test (4)` generates properly formed C code as expected, but using a GValue creates the following function call: _tmp2_ = test (G_TYPE_VALUE, (GBoxedCopyFunc) , g_value_unset, _tmp1_); It emits the GBoxedCopyFunc cast but no expression to cast. Unsurprisingly, GCC doesn't like this much and chokes.
*** This bug has been marked as a duplicate of bug 772204 ***
Basically the same as https://bugzilla.gnome.org/show_bug.cgi?id=772204
Created attachment 341687 [details] [review] vala: Check inferred generic-types of MemberAccess
Attachment 341687 [details] pushed as eda719e - vala: Check inferred generic-types of MemberAccess