Problem with partial methods

I view this as a bug, but I am open to opposing views. In the following code, RS complains about the two empty partial method declarations that they are unused (by C# rules they are private). The methods are in fact used, but according to C# rules the methods that actually proide a body to these partial methods are the ones called. So while RS is pedantically correct, in that the empty declarations are not actually executed, I think it is a RS bug to report them as such since it tends to defeat the purpose of partial methods.

namespace Tinkering
{
public partial class Class1
{
#region Methods

partial void A ( ref int b );

partial void AA ( ref int b );

public int apply ( int b )
{
A ( ref b );
AA ( ref b );
return b;
}

#endregion
}

public partial class Class1
{
#region Methods

partial void A ( ref int b )
{
b += 1;
}

partial void AA ( ref int b )
{
b += 3;
}

#endregion
}
}

Please sign in to leave a comment.