Closed simonmckenzie closed 3 months ago
Resolved by the merge of #51
Hi all FYI: it doesn't look like the fix is sticking - the error is still showing with this;
<PackageReference Include="AutomaticInterface" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
file class GenerateAutomaticInterface : Attribute;
[GenerateAutomaticInterface]
file class MyButton : System.Windows.Forms.Button;
// OR
[GenerateAutomaticInterface]
file class MyButton : System.Windows.Forms.Button
{
// This gives **2** instances of the error
public new event System.EventHandler? ImeModeChanged;
}
I really like the package though - thanks for your work so far!
HI @FinnAngelo,
My fix was only for methods. It looks like we'll need another issue for events 🤦
Would you be interested in doing this? It'll be much the same as in this PR: https://github.com/codecentric/net_automatic_interface/pull/33
If not, I can have a look later in the week.
Hi @simonmckenzie - I wont be able to start till this weekend (Sat 10 Aug) but yeah, sure!
The current code will insert multiple definitions of a method when that method has been overridden or shadowed via
new
.For example, given these two classes:
The generated interface will look like this: