Skip to content

Recognize metadata property backing fields - #4171

Merged
siegfriedpammer merged 1 commit into
masterfrom
fix/csharp3-auto-property-backing-fields
Sep 26, 2026
Merged

siegfriedpammer merged 1 commit into
masterfrom
fix/csharp3-auto-property-backing-fields

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Summary

  • Recognize property backing fields through the existing metadata lookup when CompilerGeneratedAttribute is absent.
  • Keep the static/type/name checks before treating a field as a property's backing storage.
  • Add an ILPretty regression fixture with a C#-style backing field but no CompilerGeneratedAttribute.

Testing

  • OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj --report-trx --filter FullyQualifiedName~ILPrettyTestRunner.PropertyBackingFieldWithoutCompilerGeneratedAttribute
  • Top-200 decompdiff: 37,741 types compared, 2 changed, 0 new errors, compiler-generated name leaks 2555 -> 2549

Assisted-by: OpenCode:openai/gpt-5.5:OpenCode

Some assemblies preserve the C# backing-field naming pattern and accessor shape but omit CompilerGeneratedAttribute from the field. Use the existing property/backing-field metadata lookup so those properties can still collapse to field-backed or automatic property output instead of leaking <Name>k__BackingField.

Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
@siegfriedpammer
siegfriedpammer force-pushed the fix/csharp3-auto-property-backing-fields branch from 639fd03 to 8b183ab Compare September 24, 2026 05:06
@siegfriedpammer
siegfriedpammer merged commit 7cb75cb into master Sep 26, 2026
15 checks passed
@siegfriedpammer
siegfriedpammer deleted the fix/csharp3-auto-property-backing-fields branch September 26, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant