# Is there a super type for all class instances besides "any"?

**URL:** <https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [October 19, 2023, 6:48pm UTC](https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018 "2023-10-19T18:48:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonpolo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonpolo](https://forums.unrealengine.com/u/anonpolo)\
**Post date:** [October 19, 2023, 6:48pm UTC](https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018/1 "2023-10-19T18:48:18Z")

</div>

I am implementing an interface with a method that looks like:

`Update(Payload: any): void`

I would like to type cast the payload to different types and depending on if the type cast succeeds, take some sort of action.

However, I’m hitting the error: “dynamic cast argument type ‘any’ must be a class”.

It seems like dynamic type casting is only supported for class instances. Is there a way to type my Payload parameter to signify that it is guaranteed to be a class?

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 19, 2023, 9:06pm UTC](https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018/2 "2023-10-19T21:06:28Z")

</div>

Doing generic code can be quite annoying in Verse right now, the `any` type is almost useless, I don’t try to use it anymore.

But you might have other possibilities depending on what you want to achieve exactly.

You could use parametric functions and/or classes for example 🤷

---

<div class="post-metadata">

**Author:** ![anonpolo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonpolo](https://forums.unrealengine.com/u/anonpolo)\
**Post date:** [October 19, 2023, 9:34pm UTC](https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018/3 "2023-10-19T21:34:23Z")

</div>

Yeah I thought about making a generic base class for all of my custom classes, but just feels bad haha. Plenty of workarounds, just wish that some of these language features were more flexible

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 20, 2023, 9:30am UTC](https://forums.unrealengine.com/t/is-there-a-super-type-for-all-class-instances-besides-any/1338018/4 "2023-10-20T09:30:58Z")

</div>

Yes I agree, but I think that it will be improved one day, as they say it themselves that this type lacks uses (c.f. [doc](https://dev.epicgames.com/documentation/en-us/uefn/any-in-verse))

> There is very little that you can do with an any type. but it’s good to be aware of this type as it may come up when writing code that produces an error.
