var code =
"""
using Rocks;
[assembly: RockCreate<IHandle>]
public interface IHandle
{
void Handle(string handler);
}
""";
Expected behavior
The mock is made.
Actual behavior
Errors occur:
error CS0841: Cannot use local variable '@handler' before it is declared
Additional context
This happens because a method or indexer defines a parameter with the name handler, and in the expectation handlers, Rocks doesn't check to ensure that name isn't used and create another one.
This was found on AngleSharp.Dom.IWindowTimers. It's recent with the code generation changes in 8.0.0.
To Reproduce
Expected behavior The mock is made.
Actual behavior Errors occur:
Additional context This happens because a method or indexer defines a parameter with the name
handler
, and in the expectation handlers, Rocks doesn't check to ensure that name isn't used and create another one.This was found on
AngleSharp.Dom.IWindowTimers
. It's recent with the code generation changes in 8.0.0.