Raise empty local functions - #3902
Conversation
Accept the compiler-produced terminal void return as a printable empty local-function body and remove it before emitting the declaration. Keep missing imports and malformed empty non-void bodies declined. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep a terminal null return in the synthetic non-void body and assert that shape survives the nested pipeline, so the negative reaches the new void-only acceptance branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Head moved to |
|
Round-two |
|
Head moved to |
Adversarial review reconciliationExact reviewed head: Round 1 (
|
|
Ready to merge |
voidlocal functions instead of leaving an undeclared synthesized callc278e72cChange
Conclusion: PASS — the pass now recognizes the compiler witness for an empty
voidbody, while failed imports and empty non-void bodies remain declined.Benchmark target
Benchmark target:
ILInspector.Decompiler.Tests.dllat0ff89bef/c278e72cdotnet-inspect member ILInspector.Decompiler.Tests.UnraisedLocalFunctionSamples \ --library artifacts/bin/ILInspector.Decompiler.Tests/release/ILInspector.Decompiler.Tests.dll \ -m CallsEmpty -S "Decompiled Source" --plaintext --bareOriginal source
Before
CS0103)0ff89befAfter
Exact, contract v3)c278e72cFully raised
The After decompilation is in the fully raised state.
Evidence
CallsEmpty+ 2 existing declined cases failCS0103CS0103CallsEmptyis an undeclared synthesized call atPartialFdeclaration atFullandExactThe positive test failed before the product change. Close negatives prove a missing import and a synthetic empty non-void body with the same terminal-null-return shape remain declined at
Partial.Decompiler quality
Conclusion: PASS — the exact-base PR quick card reports no regression.
PR quick gate
Run: hash-stable 100 methods per assembly, 15 assemblies, 1,500 methods.
The six delta rows are three added and three removed hash-sample identities in generated/self assemblies; there are no changed common-method rows.
Render A/B
42,210 methods evaluated; 0 changed, 0 added, 0 removed, and no regressions. This sensor has no cross-method import seam, so it is population regression evidence rather than the positive local-function witness; the seam-enabled fixture and compile-back result prove the behavior change.
Validation
dotnet build dotnet-inspect.slnx -c Releasedotnet run --project src/ILInspector.Decompiler.Tests -c Release -- -class ILInspector.Decompiler.Tests.UnraisedLocalFunctionCallTests -noColordotnet run --project src/ILInspector.Decompiler.Tests -c Release -- --gate fast -noColordotnet run --project src/ILInspector.Decompiler.Tests -c Release -- --gate pre-merge -noColorDecompilerHarness --fidelity-checkDecompilerHarness --render-ab