<commit_before>use Test;

plan 12;

{
    class Foo {
        static method ~doit { "foo" }
    }

    class Bar {
        static method ~doit { "bar" }
    }

    is Foo.doit,"foo","basic static method call";
    is Bar.doit(),"bar","basic static method call again";
}

{
    class Parent {
        static method ~dont-override { ":D"}
        static method ~override      { "parent" }
    }

    class Child is Parent {
        static method ~override { "child" }
        static method ~child-only { "child-only" }
    }

    is Child.dont-override,':D','child inherited from parent';
    is Child.override,"child",'child overridden parent';
    is Child.child-only,"child-only",'child-only method works';
    is Parent.override,"parent","overridden method in parent still works";
}


{
    class Foo { }
    is Foo<bar>,'bar','Foo<bar>';
    is Foo{'bar'},'bar','Foo{ }';
    ok Foo<bar>.chars == 3,'classes inherit from Str';
}

{
    class Foo {
        method ~second($a) { $self ~ $a ~ "baz"}
        method ~first($a)  { $self.second($a) }
    }

    is Foo<foo>.first("bar"),"foobarbaz","methods can call other methods";
}

{
    class Listy  {
        method +iterate-at {
            my $i = 0;
            for @self {
                $i++
            }<commit_msg>Test to make sure spaces are ok in type { } blessing<commit_after>use Test;

plan 13;

{
    class Foo {
        static method ~doit { "foo" }
    }

    class Bar {
        static method ~doit { "bar" }
    }

    is Foo.doit,"foo","basic static method call";
    is Bar.doit(),"bar","basic static method call again";
}

{
    class Parent {
        static method ~dont-override { ":D"}
        static method ~override      { "parent" }
    }

    class Child is Parent {
        static method ~override { "child" }
        static method ~child-only { "child-only" }
    }

    is Child.dont-override,':D','child inherited from parent';
    is Child.override,"child",'child overridden parent';
    is Child.child-only,"child-only",'child-only method works';
    is Parent.override,"parent","overridden method in parent still works";
}


{
    class Foo { }
    is Foo<bar>,'bar','Foo<bar>';
    is Foo{'bar'},'bar','Foo{ }';
    is Foo{ 'bar' },'bar','Foo{ "bar" }';
    ok Foo<bar>.chars == 3,'classes inherit from Str';
}

{
    class Foo {
        method ~second($a) { $self ~ $a ~ "baz"}
        method ~first($a)  { $self.second($a) }
    }

    is Foo<foo>.first("bar"),"foobarbaz","methods can call other methods";
}

{
    class Listy  {
        method +iterate-at {
            my $i = 0;
            for @self {
                $i++
            }
{'fraction_non_alphanumeric': 0.15685529813900495, 'fraction_numerical': 0.0030383592859855677, 'mean_word_length': 2.220048899755501, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, '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': '3553345', 'n_tokens_mistral': 891, 'n_tokens_neox': 837, 'n_words': 228}