<commit_before>//xfail-stage0
//xfail-stage1
use std;

fn main() {

    obj a() {
        fn foo() -> int {
            ret 2;
        }
        fn bar() -> int {
            ret self.foo();
        }
    }

    auto my_a = a();

    // Extending an object with a new method that contains a simple
    // self-call.  Adding support for this is issue #540.

    // Right now, this fails with a failed lookup in a hashmap; not
    // sure where, but I think it might be during typeck.
    auto my_b = obj { 
        fn baz() -> int { 
            ret self.foo(); 
        } 
        with my_a 
    };

    assert my_b.baz() == 2);

}<commit_msg>Typo fix in test case.<commit_after>//xfail-stage0
//xfail-stage1
use std;

fn main() {

    obj a() {
        fn foo() -> int {
            ret 2;
        }
        fn bar() -> int {
            ret self.foo();
        }
    }

    auto my_a = a();

    // Extending an object with a new method that contains a simple
    // self-call.  Adding support for this is issue #540.

    // Right now, this fails with a failed lookup in a hashmap; not
    // sure where, but I think it might be during typeck.
    auto my_b = obj { 
        fn baz() -> int { 
            ret self.foo(); 
        } 
        with my_a 
    };

    assert (my_b.baz() == 2);

}
{'fraction_non_alphanumeric': 0.11882716049382716, 'fraction_numerical': 0.010802469135802469, 'mean_word_length': 1.419776119402985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6531126', 'n_tokens_mistral': 441, 'n_tokens_neox': 407, 'n_words': 154}