document union type safety