Skip to content

fix: FindArrayInClosure — search plain objects in object[] (display class pattern)#83

Merged
korchak-aleksandr merged 1 commit intomainfrom
korchak/fix-find-array-in-display-class
Mar 24, 2026
Merged

fix: FindArrayInClosure — search plain objects in object[] (display class pattern)#83
korchak-aleksandr merged 1 commit intomainfrom
korchak/fix-find-array-in-display-class

Conversation

@korchak-aleksandr
Copy link
Copy Markdown
Collaborator

Problem

FindArrayInClosure only recursed into Delegate.Target when searching object[] items. But Closure.Constants can contain a plain <>c__DisplayClass (not a Delegate) that holds the actual array:

Closure.Constants[0] = <>c__DisplayClass { allowedIds = int[] }

This caused NotSupportedException at runtime when array.Contains() was used in LINQ queries going through ExecuteWithQueryCompilation.

Fix

One line: recurse into any non-null item in object[], not just Delegate.Target.

Version

10.8.1 → 10.8.2

…lass pattern)

Closure.Constants can contain a plain <>c__DisplayClass holding the array,
not only a Delegate. Recurse into any non-null item, not just Delegate.Target.
@korchak-aleksandr korchak-aleksandr merged commit 39af257 into main Mar 24, 2026
1 check passed
@korchak-aleksandr korchak-aleksandr deleted the korchak/fix-find-array-in-display-class branch March 24, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants