This fixes a bug: if type is not a primitive, then an error message is incorrectly built using the current tokenizer, which has been used after the primitive was read. Moving the `asPrimitive` call to just after reading the type token fixes it.