Home /Modules/impl/native_method_error.sleela

native_method_error.sleela

impl/tests/native_drive/native_method_error.sleela · 18 line(s) · sleela

#sleela 3.0
class NativeErrorFixture {
    @native
    static int fail(int value) {
        return value + 1;
    }

    static int check() {
        return fail(16);
    }

    // Syntax 3.0 requires void main; the smoke harness selects check() as
    // its entry with slvm_find_func() so it can assert the returned value.
    static void main() {
        int result = check();
    }
}