[SOLVED][Burst][Collection] Burst throw an error BC1025 with NativeMultiHashMap Remove

Hi,

When I enable burst, burst complains about a typeof used :

C:\Users\PATH\Library\PackageCache\com.unity.collections@0.8.0-preview.5\Unity.Collections\NativeHashMap.cs(667,13): Burst error BC1025: Accessing the type `Unity.Entities.Entity` (e.g. using `typeof`) is not supported

at Unity.Collections.NativeMultiHashMap`2<Unity.Entities.Entity,Unity.Entities.Entity>.CheckValueEQ(Unity.Collections.NativeMultiHashMap`2<Unity.Entities.Entity,Unity.Entities.Entity>* this) (at C:\Users\PATH\Library\PackageCache\com.unity.collections@0.8.0-preview.5\Unity.Collections\NativeHashMap.cs:667)
at Unity.Collections.NativeMultiHashMap`2<Unity.Entities.Entity,Unity.Entities.Entity>.Remove(Unity.Collections.NativeMultiHashMap`2<Unity.Entities.Entity,Unity.Entities.Entity>* this, Unity.Entities.Entity key, Unity.Entities.Entity value) (at C:\Users\PATH\Library\PackageCache\com.unity.collections@0.8.0-preview.5\Unity.Collections\NativeHashMap.cs:684)

Error comes from this method in NativeHashMap.cs at line 663 :

        [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
        void CheckValueEQ<TValueEQ>()
            where TValueEQ : struct, IEquatable<TValueEQ>
        {
            if (typeof(TValueEQ) != typeof(TValue))
            {
                throw new System.ArgumentException($"value is type '{typeof(TValueEQ)}' but must match the HashMap value type '{typeof(TValue)}'.");
            }
        }

Is it attended ? known ? or do I have to report a bug ?

Thks

Thanks for reporting, it’s a known issue and fixed in the latest release. See the changelog here: Change log | Collections | 0.9.0-preview.6

ok thanks :slight_smile: