From be77b3971a2ecf857c92213d5f18b39a348deacb Mon Sep 17 00:00:00 2001 From: Tyler Reid Date: Thu, 16 Nov 2023 15:53:01 -0500 Subject: [PATCH] fix dotnet 8 breakage in SlowDictionaryAccessor by getting the enumerator through IDictionary instead of IEnumerable --- src/Tomlyn/Model/Accessors/DictionaryDynamicAccessor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Tomlyn/Model/Accessors/DictionaryDynamicAccessor.cs b/src/Tomlyn/Model/Accessors/DictionaryDynamicAccessor.cs index 2cf0ad6..c6cef5e 100644 --- a/src/Tomlyn/Model/Accessors/DictionaryDynamicAccessor.cs +++ b/src/Tomlyn/Model/Accessors/DictionaryDynamicAccessor.cs @@ -227,8 +227,7 @@ public SlowDictionaryAccessor(DynamicModelReadContext context, Type dictionaryTy public override IEnumerable> GetElements(object dictionary) { - var it = (IEnumerable)dictionary; - var enumerator = (IDictionaryEnumerator)it.GetEnumerator(); + var enumerator = ((IDictionary)dictionary).GetEnumerator(); while (enumerator.MoveNext()) {