[Major] Verse types are not comparable

Summary

It’s very limiting that the language does not automatically make all types comparable. This behavior disallows creating type based lookup tables. For example, a dynamic Scene Graph component could cache some lazy lookup operation with the result in order to speed up future lookup to O(1) cost.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

# Error: 'subtype(component)' cannot be used as the type of map keys because it is not comparable for equality.
Cache: [subtype(component)]component = map {}

Expected Result

Types should be comparable.

Observed Result

Types are not comparable. A workaround using castable implies that the code base needs to know all possible subtypes ahead of time and does not permit creation of dynamic lookup tables.

Platform(s)

UEFN (v37.10)

FORT-962485 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.

This feature could be very helpful

1 Like

This should apply to all *_subtype(...) macros as well.

1 Like