Skip to content

Frozen collection tests fail on NativeAOT #78046

@VSadov

Description

@VSadov

Failures in #77934

Either the tests should be made compatible with NativeAOT (preferrable, if possible), or disabled in the NativeAOT test runs.

The typical failure looks like:

[FAIL] System.Collections.Frozen.Tests.FrozenDictionary_Generic_Tests_string_string_Ordinal.LookupItems_AllItemsFoundAsExpected(size: 1, comparer: null, specifySameComparer: False)
System.NotSupportedException : 'Xunit.Sdk.AssertEqualityComparer`1[System.Collections.Generic.HashSet`1[System.Collections.Generic.KeyValuePair`2[System.String, System.String]]].CompareTypedSets[System.Collections.Generic.KeyValuePair`2[System.String, System.String]](System.Collections.IEnumerable,System.Collections.IEnumerable)' is missing native code. MethodInfo.MakeGenericMethod() is not compatible with AOT compilation. Inspect and fix AOT related warnings that were generated when the app was published. For more information see https://aka.ms/nativeaot-compatibility
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x30
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) + 0x1c0
   at System.Collections.Frozen.Tests.FrozenDictionary_Generic_Tests`2.LookupItems_AllItemsFoundAsExpected(Int32 size, IEqualityComparer`1 comparer, Boolean specifySameComparer) + 0x280
   at System.Collections.Immutable!<BaseAddress>+0x83e170
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x14c

Something is using MethodInfo.MakeGenericMethod() and it is not an AOT-friendly pattern.

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions