dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
589 stars 52 forks source link

ParamArray overload resolution in WIG #1401

Open Jand42 opened 3 months ago

Jand42 commented 3 months ago

DomElement.ReplaceChildren can't be used easily with empty params because of overload resolution:

image

This is defined in WIG as such: "replaceChildren" => !+(T<string> + Node) ^-> T<unit>. This is a common concern for every method that we generate multiple ParamArray overloads for (!+ helper operator does that), so best to put in a piece of logic in WIG to create an empty overload too in such cases.

Workaround: .ReplaceChildren([||]: string[])