Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 7ff508b

Browse files
committed
[IL2CPP] Support private interface implementations on IDictionary and IEnumerable
1 parent 09a7cd3 commit 7ff508b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Core/Reflection/Il2CppReflection.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,9 @@ private static void PrepareCppEnumerator(object list, out object cppEnumerator,
804804

805805
if (!getEnumeratorMethods.ContainsKey(key))
806806
{
807-
getEnumeratorMethods.Add(key, type.GetMethod("GetEnumerator"));
807+
var method = type.GetMethod("System_Collections_IEnumerable_GetEnumerator", FLAGS)
808+
?? type.GetMethod("GetEnumerator");
809+
getEnumeratorMethods.Add(key, method);
808810

809811
// ensure the enumerator type is supported
810812
try
@@ -890,7 +892,9 @@ protected override bool Internal_TryGetDictEnumerator(object dictionary, out IEn
890892
var cacheKey = keys.GetType().AssemblyQualifiedName;
891893
if (!getEnumeratorMethods.ContainsKey(cacheKey))
892894
{
893-
getEnumeratorMethods.Add(cacheKey, keyCollType.GetMethod("GetEnumerator"));
895+
var method = keyCollType.GetMethod("System_Collections_IDictionary_GetEnumerator", FLAGS)
896+
?? keyCollType.GetMethod("GetEnumerator");
897+
getEnumeratorMethods.Add(cacheKey, method);
894898

895899
// test support
896900
try

0 commit comments

Comments
 (0)