basex icon indicating copy to clipboard operation
basex copied to clipboard

Coerce maps and arrays to FuncItem

Open GuntherRademacher opened this issue 1 year ago • 0 comments

Function coercion of a map or array item is currently skipped, when the funcType of the item passes an instance test for the required function type. This however preserves its array or map identity, keeping it a suitable argument for the lookup operator, which it should not be. See qt4cg/qt4tests#109.

This change makes sure that non-FuncItems are processed by FItem.coerceTo to actually return a FuncItem, when the required type is a FuncType. When coercing to function(*), the item's funcType is used instead, in order to avoid special handling that would be necessary, because there are no required argTypes.

The corresponding QT4 test case is MapTest-058a.

GuntherRademacher avatar Jun 10 '24 17:06 GuntherRademacher