On Mon, Dec 14, 2009 at 2:27 PM, John Carr <[email protected]> wrote:
> Hey, > > I noticed you used var foo = in the dynamic test. Doesn't Vala need to > know what the return type will be at compile time? I think it is > assuming it will be an object path when its actually an array of 4 > intergers. > I tried to set the return value to int[], so it doesn't had to guess the return type. But then it segfaults. vala file: http://pastebin.org/64817 generated c file: http://pastebin.org/64814 backtrace: see vala file I also tried to set the return value to a struct with 4 ints (org_freedesktop_MediaPlayer.State), but then the c-compiler errors: vlc_test2.vala.c: In function ‘_dynamic_GetStatus0’: vlc_test2.vala.c:244: error: ‘result’ redeclared as different kind of symbol vlc_test2.vala.c:243: note: previous definition of ‘result’ was here vlc_test2.vala.c:249: warning: ‘return’ with a value, in function returning void > In the static test, i wonder in vala can't yet map a return type of "4 > integers" to a struct - have you tried using int[4] as the return > type? > I have tried setting it as int[]. That doesn't work either because vala will expect a dbus signature of an array, instead of a struct. ** (process:4153): CRITICAL **: file /home/karmic/progie/awn-applets/applets/maintained/media-indicator/vlc_test.vala.c: line 383: uncaught error: Invalid signature, expected "ai", got "(iiii)" Setting it as int[4] will generate an compile error. John > Sorry I have to keep bothering you. Nikos
_______________________________________________ Vala-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/vala-list
