Index: GType.xs =================================================================== --- GType.xs (revision 1054) +++ GType.xs (working copy) @@ -2780,10 +2780,14 @@ =for arg swap (integer) =cut SV * -as_arrayref (SV *a, b, swap) +as_arrayref (SV *a, ...) PROTOTYPE: $;@ CODE: { + /* overload @{} calls here with the usual three args "a,b,swap", but + * "b" and "swap" have no meaning. Using "..." to ignore them lets + * users call method-style with no args "$f->as_arrayref" too. + */ GType gtype; const char *package; gint a_; Index: t/c.t =================================================================== --- t/c.t (revision 1054) +++ t/c.t (working copy) @@ -13,7 +13,7 @@ ######################### -use Test::More tests => 34; +use Test::More tests => 35; BEGIN { use_ok('Glib') }; ######################### @@ -216,6 +216,7 @@ is ($obj->get ('some_enum'), 'value-two', 'enum property, after set'); is_deeply (\ { $obj->get ('some_flags') }, ['value-one'], 'flags property'); +is_deeply ($obj->get('some_flags')->as_arrayref, ['value-one'], 'flags property'); $obj->set (some_flags => ['value-one', 'value-two']); is_deeply (\ { $obj->get ('some_flags') }, ['value-one', 'value-two'], 'flags property, after set');