fix regression in defun/defmethod

This commit is contained in:
2021-06-23 13:28:45 -06:00
parent 114beec3f4
commit 1e84c195be

View File

@@ -152,11 +152,13 @@ class Helpers {
var expr = if (body.length == 0) { var expr = if (body.length == 0) {
EReturn(null).withMacroPosOf(if (name != null) name else argList); EReturn(null).withMacroPosOf(if (name != null) name else argList);
} else { } else {
k.convert(CallExp(Symbol("begin").withPos(body[0].pos), body).withPos(body[0].pos)); var block = k.convert(CallExp(Symbol("begin").withPos(body[0].pos), body).withPos(body[0].pos));
}
if (returnsValue) { if (returnsValue) {
expr = EReturn(expr).withMacroPosOf(body[-1]); EReturn(block).withMacroPosOf(body[-1]);
} else {
block;
};
} }
// To make function args immutable by default, we would use (let...) instead of (begin...) // To make function args immutable by default, we would use (let...) instead of (begin...)