mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
An anonymous function's own method does not reliably carry ParamArrayAttribute - Roslyn 4.14 omits it - while the delegate's Invoke method always describes the full signature, and it is Invoke that call sites bind against. Reading the modifiers from the anonymous function alone therefore dropped 'params' from the parameter list while the call was still decompiled in expanded form, which does not compile: the natural type of the re-emitted lambda is a plain Func<int[], int>, taking exactly one argument. Sourcing both modifiers from Invoke also makes the pre-C# 12 downgrade to [ParamArray]/[Optional] fire on every compiler rather than only the newest. Assisted-by: Claude:claude-opus-5[1m]:Claude Codepull/4004/head
4 changed files with 24 additions and 28 deletions
Loading…
Reference in new issue