-
Put this code in a .NET 9/C#13 console app and launch in debug mode: using System.Collections.ObjectModel;
using System.Diagnostics;
var names1 = GetNames1();
var names2 = GetNames2();
Debugger.Break();
static IReadOnlyCollection<string> GetNames1() => ["Alice", "Bob", "Charlie"];
static IReadOnlyCollection<string> GetNames2() => new ReadOnlyCollection<string>(["Alice", "Bob", "Charlie"]); The QoL difference between debugging It's because [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")] Can the compiler-generated class for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Feel free to file this as an issue (or click "Create issue from discussion" if it is available to you). I think it would be reasonable to just take a PR to make this change. No language spec change needed. |
Beta Was this translation helpful? Give feedback.
See #78651. Thank you.