<commit_before>    use v6;

use Test;

plan 8;

=begin pod

These are misc. sub argument errors.

=end pod

sub bar (*@x) { 1 }   #OK not used
lives_ok { bar(reverse(1,2)) }, 'slurpy args are not bounded (2)';  

eval_dies_ok 'sub quuux ($?VERSION) { ... }',
             'parser rejects magicals as args (1)';
eval_lives_ok 'sub quuuux ($!) { ... }', 'but $! is OK';

# RT #64344
{
    sub empty_sig() { return };
    dies_ok { eval('empty_sig("RT #64344")') },
            'argument passed to sub with empty signature';
}

# RT #71478
{
    my $success = try { eval 'sub foo(%h) { %h }; foo(1, 2); 1' };
    my $error   = "$!";
    nok $success,
        "Passing two arguments to a function expecting one hash is an error";
    ok $error ~~ / '%h' /,   '... error message mentions parameter';
    ok $error ~~ /:i 'type' /, '... error message mentions "type"';
    ok $error ~~ / Associative | \% /, '... error message mentions "Associative" or the % sigil';
}

# vim: ft=perl6<commit_msg>test for RT #109064<commit_after>    use v6;

use Test;

plan 9;

=begin pod

These are misc. sub argument errors.

=end pod

sub bar (*@x) { 1 }   #OK not used
lives_ok { bar(reverse(1,2)) }, 'slurpy args are not bounded (2)';  

eval_dies_ok 'sub quuux ($?VERSION) { ... }',
             'parser rejects magicals as args (1)';
eval_lives_ok 'sub quuuux ($!) { ... }', 'but $! is OK';

# RT #64344
{
    sub empty_sig() { return };
    dies_ok { eval('empty_sig("RT #64344")') },
            'argument passed to sub with empty signature';
}

# RT #71478
{
    my $success = try { eval 'sub foo(%h) { %h }; foo(1, 2); 1' };
    my $error   = "$!";
    nok $success,
        "Passing two arguments to a function expecting one hash is an error";
    ok $error ~~ / '%h' /,   '... error message mentions parameter';
    ok $error ~~ /:i 'type' /, '... error message mentions "type"';
    ok $error ~~ / Associative | \% /, '... error message mentions "Associative" or the % sigil';
}

# RT #109064
eval_dies_ok 'my class A { submethod BUILD(:$!notthere = 10) }; A.new',
    'named parameter of undeclared attribute dies';

# vim: ft=perl6
{'fraction_non_alphanumeric': 0.1735653809971778, 'fraction_numerical': 0.031044214487300093, 'mean_word_length': 2.7185314685314683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2320725', 'n_tokens_mistral': 807, 'n_tokens_neox': 760, 'n_words': 254}