Allow void return type
This commit is contained in:
parent
47b3c3b2c0
commit
0a5fdf71a4
@ -338,6 +338,10 @@ func compileFunctionWAT(function ParsedFunction) (string, error) {
|
||||
returnTypes = function.ReturnType.Value.(TupleType).Types
|
||||
}
|
||||
|
||||
if function.ReturnType.Type == Type_Void {
|
||||
returnTypes = []Type{}
|
||||
}
|
||||
|
||||
for _, t := range returnTypes {
|
||||
funcWAT += "\t(result " + getWATType(t) + ")\n"
|
||||
}
|
||||
|
@ -2,6 +2,14 @@ u64 add(u8 a, u8 b) {
|
||||
return add(a - 1u8, a);
|
||||
}
|
||||
|
||||
u64 add2(u64 a, u64 b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
void a() {
|
||||
|
||||
}
|
||||
|
||||
(u8, u8) doNothing(u8 a, u8 b) {
|
||||
return a, b;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user