Rejection of dynamic function invocations on empty loops (mistaken for object/array lookup)
Bug #1171860 reported by
Ghislain Fourny
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Medium
|
Markos Zaharioudakis |
Bug Description
This query raises an error, although it looks valid to me:
for $f in () return $f()
This is because $f seems to be typed as the empty sequence, which is a subtype of json-item()*, which leads to $f()'s being recognized as an object lookup, which fails because it is not unary.
More generally, should $f on an empty loop not be typed as item() (or item()? if using "allowing empty")? This would have the nice effect that $f() would be recognized as a dynamic function invocation.
tags: | added: fots |
Changed in zorba: | |
status: | New → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
There are two expecting failures related to this in FOTS:
EXPECTED_ FOTS_FAILURE (prod-RequirePr ohibitFeature require- higher- order-function- 5-s 0) FOTS_FAILURE (prod-RequirePr ohibitFeature require- higher- order-function- 10-s 0)
EXPECTED_