CodeGenHelpers icon indicating copy to clipboard operation
CodeGenHelpers copied to clipboard

WithBaseCall will ommit second parameter with same type due to Dictionary usage

Open vmachacek opened this issue 3 years ago • 2 comments

I'm not sure if I'm doing something crazy but I have this code

.AddConstructor(Accessibility.Public).WithBaseCall(new Dictionary<string, string>()
{
    ["IPage"] = "page",
    ["string"] = "absolutePath",
    ["string"] = "elementPath",
})

which will result in

 public FooBar(IPage page, string elementPath)
            : base(page, elementPath)
        {
            Page = page;
        }

because Dictionary is used the third param will overwrite the second. How can I add two params of same type?

vmachacek avatar Apr 11 '23 14:04 vmachacek

I'd say this seems like an oversight and a bug.

dansiegel avatar Apr 11 '23 15:04 dansiegel

i made this PR https://github.com/dansiegel/CodeGenHelpers/pull/54

vmachacek avatar Apr 11 '23 16:04 vmachacek