GNOME Bugzilla – Bug 792077
too few arguments error to delegate returning a delegate
Last modified: 2018-01-06 15:05:59 UTC
This code doesn't compile: // delegate returning a function public delegate Func<G> FuncGenerator<G> (); void main () { FuncGenerator<int> func_generator = () => { return (data) => { print("hello %d!\n", data); }; }; Func<int> func = func_generator(); } -------------------------------------------------- output: /tmp/test.vala.QBFDCZ.c: In function ‘__lambda4_’: /tmp/test.vala.QBFDCZ.c:36:9: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] _tmp0_ = ___lambda5__gfunc; ^ /tmp/test.vala.QBFDCZ.c: In function ‘_vala_main’: /tmp/test.vala.QBFDCZ.c:65:11: error: too few arguments to function ‘func_generator’ _tmp1_ = func_generator (&_tmp0_, func_generator_target); ^~~~~~~~~~~~~~ error: cc exited with status 256
Created attachment 366416 [details] [review] codegen: Add destroy out-param when invoking delegate returned by delegate
Attachment 366416 [details] pushed as ecb8a6f - codegen: Add destroy out-param when invoking delegate returned by delegate