nuke icon indicating copy to clipboard operation
nuke copied to clipboard

Source generator for better access of members from inherited components

Open matkoch opened this issue 2 years ago • 2 comments

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

matkoch avatar Aug 21 '22 17:08 matkoch

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

frosch95 avatar Oct 04 '23 21:10 frosch95

Sure. Feel free to submit something.

matkoch avatar Oct 04 '23 22:10 matkoch