From bce58d373fad048a8e30bd1794953f7ebb081540 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 26 Mar 2017 15:16:18 +0100 Subject: [PATCH] src/method-proto.lisp: Set `*keyword-struct-disposition*' properly. Organization: Straylight/Edgeware From: Mark Wooding No idea where this one came from. --- src/method-proto.lisp | 3 ++- test/test.sod | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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 -------------------------------------------------*/ -- [mdw]