Only works on collections and built-ins.

And in the case of a collection, CAST apparently needs to be used on a query.