diff --git a/src/boot/sysobj.reb b/src/boot/sysobj.reb index 9a2eadaee1..2824401eef 100644 --- a/src/boot/sysobj.reb +++ b/src/boot/sysobj.reb @@ -39,7 +39,7 @@ catalog: object [ words [any-function! any-object! map! date!] values [any-object! map!] types [any-function!] - title [any-function! datatype!] + title [any-function! datatype! module!] ] ; Official list of system/options/flags that can appear. ; Must match host reb-args.h enum! diff --git a/src/core/t-object.c b/src/core/t-object.c index 2477eb3eb5..4ae297f2f2 100644 --- a/src/core/t-object.c +++ b/src/core/t-object.c @@ -481,10 +481,15 @@ static REBSER *Trim_Object(REBSER *obj) case A_REFLECT: action = What_Reflector(arg); // zero on error - if (action == OF_SPEC) { + if (action == OF_SPEC || action == OF_TITLE) { if (!VAL_MOD_SPEC(value)) return R_NONE; VAL_OBJ_FRAME(value) = VAL_MOD_SPEC(value); VAL_SET(value, REB_OBJECT); + if (action == OF_TITLE) { + REBCNT n = Find_Word_Index(VAL_OBJ_FRAME(value), SYM_TITLE, FALSE); + if(!n) return R_NONE; + value = VAL_OBJ_VALUE(value, n); + } break; } // Adjust for compatibility with PICK: diff --git a/src/tests/units/module-test.r3 b/src/tests/units/module-test.r3 index c3d3fff965..ef2e8b93e5 100644 --- a/src/tests/units/module-test.r3 +++ b/src/tests/units/module-test.r3 @@ -83,6 +83,11 @@ supplement system/options/module-paths join what-dir %units/files/ ===end-group=== ===start-group=== "make module" + --test-- "title-of" + ;@@ https://github.com/Oldes/Rebol-issues/issues/572 + test: module [Title: "Test Module"] [] + --assert "Test Module" = try [title-of test] + --test-- "inlined module" ;@@ https://github.com/Oldes/Rebol-issues/issues/1628 unset 'z1 z2: 2