Improves safety of UnionSchemaImpl.recursiveEquals