From: Mark Wooding Date: Sun, 26 Mar 2017 14:16:18 +0000 (+0100) Subject: src/method-proto.lisp: Set `*keyword-struct-disposition*' properly. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/bce58d373fad048a8e30bd1794953f7ebb081540?hp=91116f94e1683dc902a7e10eadd6186fe7d7255c src/method-proto.lisp: Set `*keyword-struct-disposition*' properly. No idea where this one came from. --- diff --git a/src/method-proto.lisp b/src/method-proto.lisp index 048c924..d019997 100644 --- a/src/method-proto.lisp +++ b/src/method-proto.lisp @@ -428,7 +428,8 @@ (defun make-trampoline (codegen super body) (cons (make-argument *sod-key-pointer* (c-type (* (void :const)))) raw-args)))) - (*keyword-struct-disposition* t)) + (*keyword-struct-disposition* (if (effective-method-keywords method) + :pointer :null))) (codegen-push codegen) (ensure-ilayout-var codegen super) (when (and (keyword-message-p message) diff --git a/test/test.sod b/test/test.sod index f7f3537..6bc775b 100644 --- a/test/test.sod +++ b/test/test.sod @@ -225,4 +225,27 @@ code c : tests { } } +/*----- Keyword argument propagation --------------------------------------*/ + +[link = SodObject, nick = base] +class T3Base : SodObject { + void m0(?int x) { STEP(x); } + void m1(?) { } +} + +[link = T3Base, nick = sub] +class T3Sub : T3Base { + void base.m0(?int z) { STEP(z); CALL_NEXT_METHOD; } + void base.m1(?int z) { STEP(z); CALL_NEXT_METHOD; } +} + +code c : tests { + prepare("kwargs"); + { SOD_DECL(T3Sub, t, NO_KWARGS); + T3Base_m0(t, KWARGS(K(z, 0) K(x, 1))); + T3Base_m1(t, KWARGS(K(z, 2))); + DONE(3); + } +} + /*----- That's all, folks -------------------------------------------------*/