[GFX-203] feature/GFX-203 - #109
Conversation
把 public override int GetHashCode() 体内的 'throw new NotSupportedException();' 改为 'throw new UnreachableException();',并在顶部 using 区按字母序新增 'using System.Diagnostics;'。
[Obsolete("...", true)] 让任何调用方在编译期被 CS0619 拒绝,方法体 throw 实际不可达;改用 System.Diagnostics.UnreachableException(.NET 5+,构造函数标注 [DoesNotReturn]),Roslyn / Sonar 会识别这条 throw 为不可达,S3877 告警消除。
公共形态(method / [Obsolete(..., true)] / [EditorBrowsable] / #pragma CS0809 / XML 文档)零改动。
Linear: GFX-203
📝 WalkthroughWalkthroughCrc64哈希实现引入 ChangesCrc64哈希异常更新
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs`:
- Line 679: 同步更新相关方法的 XML 文档,将异常声明从 NotSupportedException 改为实际抛出的
UnreachableException,并确保 returns 文档与该方法当前行为保持一致。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 04f45774-35d9-450e-9009-7743cdbdd8d6
📒 Files selected for processing (1)
GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs
| #pragma warning restore CS0809 // Obsolete member overrides non-obsolete member | ||
| { | ||
| throw new NotSupportedException(); | ||
| throw new UnreachableException(); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
同步 XML 文档中的异常类型。
当前实现抛出 UnreachableException,但上方 Line 671-672 仍声明会抛出 NotSupportedException。请同步更新 <returns> 和 <exception cref> 文档,避免生成的 API 文档与实际行为不一致。
建议修改
- /// <returns>此方法将始终抛出 <see cref="NotSupportedException"/> / This method will always throw a <see cref="NotSupportedException" /></returns>
- /// <exception cref="NotSupportedException">在所有情况下抛出 / In all cases</exception>
+ /// <returns>此方法将始终抛出 <see cref="UnreachableException"/> / This method will always throw a <see cref="UnreachableException" /></returns>
+ /// <exception cref="UnreachableException">在所有情况下抛出 / In all cases</exception>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs` at line 679, 同步更新相关方法的 XML
文档,将异常声明从 NotSupportedException 改为实际抛出的 UnreachableException,并确保 returns
文档与该方法当前行为保持一致。




Linear: GFX-203
Summary by CodeRabbit