Skip to content

Commit 7f3234e

Browse files
authored
FIX: Compose on Maps values that evaluate to a block expands the map.
Related to: Oldes/Rebol-issues#2686
1 parent 7632b8b commit 7f3234e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/c-do.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,8 @@ x*/ static REBINT Do_Args_Light(REBVAL *func, REBVAL *path, REBSER *block, REBCN
13991399
DSP++; // !!!DSP temp
14001400
if (THROWN(DS_TOP)) return;
14011401

1402-
// If result is a block, and not /only, insert its contents:
1403-
if (IS_BLOCK(DS_TOP) && !only) {
1402+
// If result is a block, and not /only or a map value, insert its contents:
1403+
if (IS_BLOCK(DS_TOP) && !only && !IS_MAP(block)) {
14041404
// Append series to the stack:
14051405
SERIES_TAIL(DS_Series) = DSP; // overwrites TOP value
14061406
Append_Series(DS_Series, (REBYTE *)VAL_BLK_DATA(DS_TOP), VAL_BLK_LEN(DS_TOP));

src/tests/units/evaluation-test.r3

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ Rebol [
505505
--assert #[num: 4] = use[v][v: 4 compose #[num: (v)]]
506506
--assert #[num: 5] = apply func [val] [compose/deep #[num: (val)]] [5]
507507

508+
;@@ https://github.com/Oldes/Rebol-issues/issues/2686
509+
--assert #[num: [one two three]] = compose #[num: ([one two three])]
510+
508511
===end-group===
509512

510513
===start-group=== "unset value passing"

0 commit comments

Comments
 (0)