C# 13 introduces a feature that allows `params` to be any of the collections supported by collection expressions, rather than just arrays. This enhancement builds on collection expressions introduced in C# 12, enabling simpler and more efficient method calls. This change optimizes performance by allowing the compiler to use stack space and special high-performance types for collection interfaces. Method overloading with `params` collections is also enhanced, providing more flexibility and better performance in applications.

5m read timeFrom devblogs.microsoft.com
Post cover image
Table of contents
Laying the groundwork with collection expressions Copy linkparams arrays Copy linkparams collections Copy linkOverloading Copy linkConsidering overloads Copy linkSummary Copy link

Sort: