[Observable] should be tested with semi-automatic properties in C# 14

Resolved 💬 2 comments Opened Nov 30, 2025 by gfraiteur Closed Nov 30, 2025

The [Observable] aspect has not been tested with C# 14 semi-automatic properties using the field keyword.

Background

C# 14 introduces semi-automatic properties that use the field keyword to access an auto-generated backing field:

public string Name
{
    get => field;
    set => field = value?.Trim() ?? throw new ArgumentNullException();
}

Required Testing

The [Observable] aspect in Metalama.Patterns.Observability needs testing with:

  1. Semi-automatic properties using field keyword
  2. Dependency analysis of properties using field
  3. Change notification generation for field-backed properties
  4. Computed properties that depend on semi-automatic properties

Acceptance Criteria

  • [ ] Add aspect tests for semi-automatic properties
  • [ ] Verify PropertyChanged events are raised correctly
  • [ ] Verify dependency tracking works for computed properties depending on semi-automatic properties
  • [ ] Document any limitations or special behaviors

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗