Skip to content

Conversation

@DecSmith42
Copy link
Owner

@DecSmith42 DecSmith42 commented Jul 25, 2025

Introduce GenerateInterfaceMembersAttribute for marking classes and a source generator to dynamically generate methods and properties for default interface implementations.

This ensures ease of accessing default implementations from parent interfaces within partial classes.

…nerator

Introduce `GenerateInterfaceMembersAttribute` for marking classes and a source generator to dynamically generate methods and properties for default interface implementations.

This ensures ease of accessing default implementations from parent interfaces within partial classes.
Copilot AI review requested due to automatic review settings July 25, 2025 04:18
@DecSmith42 DecSmith42 changed the title feat(source-generator): add GenerateInterfaceMembers attribute and ge… feat(source-generator): add GenerateInterfaceMembers attribute and generator Jul 25, 2025
@DecSmith42 DecSmith42 enabled auto-merge July 25, 2025 04:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a source generator system to automatically generate private wrapper methods and properties for default interface implementations. The purpose is to enable easier access to default interface implementations from within partial classes by generating bridge code that casts to the interface and calls the default implementation.

  • Adds GenerateInterfaceMembersAttribute to mark classes for code generation
  • Implements GenerateInterfaceMembersSourceGenerator to generate private wrapper methods and properties
  • Creates bridge code that allows accessing default interface implementations through private members

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
DecSm.Atom/Build/Definition/GenerateInterfaceMembersAttribute.cs Defines the attribute to mark classes for interface member generation
DecSm.Atom.SourceGenerators/GenerateInterfaceMembersSourceGenerator.cs Implements the source generator that creates private wrapper methods and properties for default interface implementations

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.

2 participants