Files
Noja/tests/compiler/func/Testcase_011_009.noja-test
T

34 lines
462 B
Plaintext

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