I have the following code:
let phxUpdateTree: Elements = walk(elements: innerHtml) {(node) -> Node in
return applyPhxUpdate(DOM.attribute(node, "phx-update"), htmlTree, node)
}
The walk
function is overloaded with two function signatures:
static func walk(elements: Elements, _ closure: (_ node: Node)throws -> Node)throws -> Elements {
...
static func walk(node: Node, _ closure: (_ node: Node)throws -> Node)throws -> Node {
and I am getting the error Type of expression is ambiguous without more context
My understanding is that it wouldn't have been ambiguous due to the type constraint (element
is of type Element
which is a subclass of Node
) so I changed to the specific labels and still get the same error which makes me suspect the error is something else but I'm not seeing it.