Skip to content

Commit 514e8e7

Browse files
committed
FIX: limit SET to just WORD! and LIT-WORD! instead of ANY-WORD!
Fixes: metaeducation/rebol-issues#2366
1 parent 798cf0a commit 514e8e7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/boot/natives.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ parse: native [
546546

547547
set: native [
548548
{Sets a word, path, block of words, or object to specified value(s).}
549-
word [any-word! any-path! block! object!] {Word, block of words, path, or object to be set (modified)}
549+
word [word! lit-word! any-path! block! object!] {Word, block of words, path, or object to be set (modified)}
550550
value [any-type!] {Value or block of values}
551551
/any {Allows setting words to any value, including unset}
552552
/only {Block or object value argument is set as a single value}

src/tests/units/evaluation-test.r3

+5
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ Rebol [
405405
--assert d = set/any [A B] d
406406
--assert all [a = 4 unset? :b]
407407

408+
--test-- "Set - issue 2366"
409+
;@@https://github.com/rebol/rebol-issues/issues/2366
410+
--assert error? try [set #ab 1]
411+
--assert error? try [set #12 2]
412+
408413

409414
===end-group===
410415

0 commit comments

Comments
 (0)