diff --git a/kiss/src/kiss/SpecialForms.hx b/kiss/src/kiss/SpecialForms.hx index 09f76230..05fb52f4 100644 --- a/kiss/src/kiss/SpecialForms.hx +++ b/kiss/src/kiss/SpecialForms.hx @@ -273,10 +273,11 @@ class SpecialForms { // Therefore only one case is required in a case statement, because one case could be enough // to cover all patterns. wholeExp.checkNumArgs(2, null, '(case [expression] [cases...] [optional: (otherwise [default])])'); + var b = wholeExp.expBuilder(); var defaultExpr = switch (args[-1].def) { - case CallExp({pos: _, def: Symbol("otherwise")}, [otherwiseExp]): + case CallExp({pos: _, def: Symbol("otherwise")}, otherwiseExps): args.pop(); - k.convert(otherwiseExp); + k.convert(b.begin(otherwiseExps)); default: null; }; diff --git a/kiss/src/test/cases/BasicTestCase.kiss b/kiss/src/test/cases/BasicTestCase.kiss index a0532e66..599984f6 100644 --- a/kiss/src/test/cases/BasicTestCase.kiss +++ b/kiss/src/test/cases/BasicTestCase.kiss @@ -378,7 +378,12 @@ ((Some (as inner (Some v))) (Assert.equals 5 v) (Assert.isTrue (Type.enumEq (Some 5) inner))) - (otherwise (Assert.fail)))) + (otherwise (Assert.fail))) + + // Otherwise blocks should allow multiple expressions, too: + (case 5 + (otherwise + 6 5))) (function _testMaps [] (localVar :Map myMap [=>"hey" "you"