REBOL3 tracker
  0.9.12 beta
Ticket #0001364 User: anonymous

Project:



rss
TypeBug Statustested Date30-Nov-2009 15:45
Versionalpha 95 CategoryError Handling Submitted bymeijeru
PlatformAll Severitytext Prioritynormal

Summary ASSERT/TYPE gives strange error message when type(set) is not literal
Description The fact that the value to be tested must be a word or path has been treated in a previous ticket. The type(set) against which to test must apparently also be a literal. If it is not, various strange error-messages may ensue.
Example code
>> a: "bc"
== "bc"
>> assert/type [a string!]
== true
>> t: make typeset! [char! string!]
== make typeset! [char! string!]
>> assert/type [a make typeset! [char! string!]]
** Script error: make type is not allowed here
;; make is not a type!!
>> assert [a t]
== true
>> assert/type compose [a (make typeset! [char! string!])]
** Script error: typeset! type is not allowed here
;; this error message is beside the point, because a typeset IS allowed

Assigned ton/a Fixed inalpha 97 Last Update8-Feb-2010 01:34


Comments
(0001840)
BrianH
2-Dec-2009 08:44

Ah, but a typeset isn't allowed, only a word or block of words which refer to types or typesets. The name is not the thing named. The bug here is that the error message doesn't make this more clear.

On the other hand, you could turn this into a Wish that literal typesets and datatypes be supported by ASSERT/type - that would be interesting. It might be unnecessary though, since this works:

>> a: "bc"
== "bc"
>> assert/type [a [char! string!]]
== true
>> assert/type compose/only [a ([char! string!])]
== true
(0001981)
Carl
6-Feb-2010 23:07

Added typesets and datatypes.

Date User Field Action Change
8-Feb-2010 01:34 BrianH Status Modified built => tested
6-Feb-2010 23:18 Carl Fixedin Modified => alpha 97
6-Feb-2010 23:18 Carl Status Modified reviewed => built
6-Feb-2010 23:07 Carl Comment : 0001981 Added -
2-Dec-2009 08:44 BrianH Comment : 0001840 Added -
2-Dec-2009 08:38 BrianH Description Modified -
2-Dec-2009 08:38 BrianH Code Modified -
2-Dec-2009 08:38 BrianH Category Modified Unspecified => Error Handling
2-Dec-2009 08:38 BrianH Severity Modified minor => text
2-Dec-2009 08:38 BrianH Status Modified submitted => reviewed
30-Nov-2009 15:45 MEIJERU Ticket Added -