From 95fc0fd0f83a29ad842baff11717dd6a824ed33d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:51:19 +0000 Subject: [PATCH] Update Modern Syntax range to C# 10-14 and add unbound generics nameof example Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/8cdef112-415b-4769-877d-61f0e7a300eb --- .skills/csharp-best-practices/SKILL.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.skills/csharp-best-practices/SKILL.md b/.skills/csharp-best-practices/SKILL.md index ba4d826c..8eb731ef 100644 --- a/.skills/csharp-best-practices/SKILL.md +++ b/.skills/csharp-best-practices/SKILL.md @@ -287,7 +287,7 @@ using PacketMap = System.Collections.Generic.Dictionary $"{prefix} {name}"; ``` -## Modern Syntax (C# 10–12) +## Modern Syntax (C# 10–14) ### File-Scoped Namespaces @@ -961,9 +961,10 @@ public bool IsAlive => Health > 0; _ = int.TryParse(s, out int result); (_, int y, _) = GetCoordinates(); -// CORRECT: nameof for resilient refactoring +// CORRECT: nameof for resilient refactoring (unbound generics in C# 14) throw new ArgumentException("Invalid value", nameof(packetId)); LogToConsole($"{nameof(AutoEat)}: eating {item.Name}"); +string typeName = nameof(Dictionary<,>); // "Dictionary" // CORRECT: static lambdas prevent accidental closure allocations list.Sort(static (a, b) => a.Id.CompareTo(b.Id));