Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source generator for better access of members from inherited components #1004

Open
matkoch opened this issue Aug 21, 2022 · 2 comments
Open

Comments

@matkoch
Copy link
Member

matkoch commented Aug 21, 2022

Description

partial class Build : NukeBuild, IHazRepository
{
   public void M()
   {
       // without source generator
       var r1 = ((T)(object)this).Repository;

       // with source generator
       var r2 = IHazRepository.Repository;
   }
}

Generated code

partial class Build
{
    // for all interfaces deriving from INukeBuild
    protected IHazRepository IHazRepository => this;
}

Usage Example

No response

Alternative

No response

@frosch95
Copy link

frosch95 commented Oct 4, 2023

Hi @matkoch ,
I would give this a try, if it is still relevant.
Bye,
Andi

@matkoch
Copy link
Member Author

matkoch commented Oct 4, 2023

Sure. Feel free to submit something.

frosch95 added a commit to frosch95/nuke that referenced this issue Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants