Skip to content

Commit eaeb6c6

Browse files
committed
FIX: using typeset should not found datatype value inside a block
``` >> find reduce [integer! binary!] series! == none ;<--- was not none before >> find reduce [integer! "aha"] series! == ["aha"] ``` related to: Oldes/Rebol-issues#256
1 parent 8a67a52 commit eaeb6c6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/core/t-block.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static void No_Nones_Or_Logic(REBVAL *arg) {
158158
}
159159
if (IS_TYPESET(target)) {
160160
if (TYPE_CHECK(target, VAL_TYPE(value))) return index;
161-
if (IS_DATATYPE(value) && TYPE_CHECK(target, VAL_DATATYPE(value))) return index;
161+
//if (IS_DATATYPE(value) && TYPE_CHECK(target, VAL_DATATYPE(value))) return index; //@@ issues/256
162162
if (IS_TYPESET(value) && EQUAL_TYPESET(value, target)) return index;
163163
}
164164
if (flags & AM_FIND_MATCH) break;

src/tests/units/datatype-test.r3

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Rebol [
2525
--test-- "find datatype!"
2626
;@@ https://github.com/Oldes/Rebol-issues/issues/256
2727
--assert found? find [#[datatype! string!] #[datatype! binary!]] #[datatype! binary!]
28+
--assert found? find reduce [string! binary!] binary!
29+
--assert found? find [#[datatype! string!] #[datatype! binary!]] #[datatype! binary!]
30+
--assert found? find ["test"] string!
31+
--assert found? find ["test"] series!
32+
--assert none? find reduce [integer! binary!] series!
33+
--assert ["aha"] = find reduce [integer! "aha"] series!
2834

2935
===end-group===
3036

0 commit comments

Comments
 (0)