[tests] Render an empty string for function pointers when computing DocIds. - #26572
[tests] Render an empty string for function pointers when computing DocIds.#26572rolfbjarne wants to merge 2 commits into
Conversation
Cecil's TypeReference.IsNested throws for FunctionPointerType instances (function pointers can't be nested types, so GetDocId must return early for them instead of trying to compute a doc id for a construct that doesn't have one. Extracted from the CoreMidi PR (dev/rolf/coremidi-copilot), since CoreMidi's MidiDriverInterface introduces the first unmanaged function pointer fields in the codebase and exposed this gap in the doc test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> EOF )
…terType fix. The GetDocId fix for FunctionPointerType changes the doc id computed for methods with function pointer parameters: they were previously rendered with a bogus ".method" placeholder, and are now rendered as an empty string (matching the actual absence of a doc id fragment for such parameters). Regenerated with WRITE_KNOWN_FAILURES=1. Ref: dotnet/roslyn#48363 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited in scope, match Roslyn’s documented current output, and the known-failures list has been updated accordingly.
Pull request overview
Aligns the Cecil-based DocId computation used by tests/cecil-tests with Roslyn’s current behavior for function pointer types, so doc ID comparisons and known-failure tracking match what the compiler emits.
Changes:
- Treat
Mono.Cecil.FunctionPointerTypeas an empty string inGetDocId (TypeReference)to match Roslyn’sDocumentationCommentIdoutput. - Update
Documentation.KnownFailures.txtentries whose DocIds changed as a result of the new function-pointer formatting.
File summaries
| File | Description |
|---|---|
| tests/cecil-tests/Documentation.cs | Adjusts DocId rendering to return an empty string for function pointer types. |
| tests/cecil-tests/Documentation.KnownFailures.txt | Updates known-failure DocIds to match the new function pointer rendering. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
| if (tr is FunctionPointerType) | ||
| return ""; |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #f3a053a] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 264 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Roslyn renders the DocId for function pointers as a simple string, so let us do the same thing.
Ref: dotnet/roslyn#48363
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com