BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
694 stars 265 forks source link

Coerce maps and arrays to FuncItem #2304

Closed GuntherRademacher closed 4 months ago

GuntherRademacher commented 5 months ago

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.