Home /Modules/impl/native_method_aot_semantic_reject.sleela

native_method_aot_semantic_reject.sleela

impl/tests/native_drive/native_method_aot_semantic_reject.sleela · 40 line(s) · sleela

#sleela 3.0
class NativeAotSemanticReject {
    @native
    static boolean invalidLogical(int value) {
        return value && true;
    }

    @native
    static boolean invalidConditional(int value) {
        return value ? true : false;
    }

    @native
    static boolean invalidNegation(int value) {
        return !value;
    }

    @native
    static int invalidWhile(int value) {
        while (value) {
            return 1;
        }
        return 0;
    }

    @native
    static int invalidFor(int value) {
        for (int i = 0; value; i = i + 1) {
            break;
        }
        return 0;
    }

    static void main() {
        if (1) {
            return;
        }
    }
}