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.
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-
FuncItem
s are processed byFItem.coerceTo
to actually return aFuncItem
, when the required type is aFuncType
. When coercing tofunction(*)
, the item'sfuncType
is used instead, in order to avoid special handling that would be necessary, because there are no requiredargTypes
.The corresponding QT4 test case is
MapTest-058a
.