The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use strict;
use warnings;
use Test::More;

{
    package Foo;

    use Moose;
    use MooseX::Method::Signatures;

    method bar (:$baz = 42) { $baz }
}

my $o = Foo->new;
is($o->bar, 42);
is($o->bar(baz => 0xaffe), 0xaffe);

done_testing;