Files
Noja/tests/compiler/func/Testcase_011_006.noja-test

28 lines
342 B
Plaintext

@type [compiler]
@source
fun add(a: int, b) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
ASS "b";
POP 1;
PUSHVAR "int";
CHECKTYPE 0, "a";
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;