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
This commit is contained in:
copilot-swe-agent[bot] 2026-03-22 15:51:19 +00:00
parent 4ac3601aa7
commit 95fc0fd0f8

View file

@ -287,7 +287,7 @@ using PacketMap = System.Collections.Generic.Dictionary<int, System.Action<byte[
var greet = (string name, string prefix = "Player") => $"{prefix} {name}";
```
## Modern Syntax (C# 1012)
## Modern Syntax (C# 1014)
### 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));