Skip to content

Commit b208401

Browse files
TMHSDigitalclaude
andcommitted
fix: stop recommending C# 10+ features that Unity 6 cannot compile
The C# conventions rule told the AI to use file-scoped namespaces and primary constructors. Unity 6 compiles C# 9, so both fail to build. Replace them with an explicit C# 9 constraint (#30). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpEiWjv38TrdFcgqU8ER5L
1 parent 7997fab commit b208401

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎rules/csharp-unity-conventions.mdc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ standards-version: 1.10.0
2020
- Prefer async/await with Awaitable (Unity 6+) over IEnumerator coroutines for new code
2121
- An Awaitable instance must never be awaited more than once (it is pooled)
2222
- Use `FindFirstObjectByType<T>()` instead of the deprecated `FindObjectOfType<T>()`
23-
- Use file-scoped namespaces to reduce nesting
24-
- Prefer primary constructors for simple data types
23+
- Unity 6 compiles C# 9: use block-scoped namespaces (`namespace MyGame { ... }`)
24+
- Do not use C# 10+ features: file-scoped namespaces, primary constructors on classes or structs, `required` members, raw string literals, collection expressions

0 commit comments

Comments
 (0)