Project

Profile

Help

Bug #5060

closed

Overzealous type checking for lookup operator

Added by Debbie Lockett over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2021-08-10
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:

Description

It seems like the compile-time type checking for the lookup operator is too strong. For instance the expression //p?innerHTML fails to compile, with the error message:

XPTY0004  The left-hand operand of '?' must be a map or an array; the supplied expression is of type element(Q{}p)

But as I understand it, if the left-hand side resolves to the empty sequence at run-time, then this is not an error. The expression ()?prop returns the empty sequence; it is not an error. (See QT3 tests Lookup-147, Lookup-148, Lookup-149.)

Please register to edit this issue

Also available in: Atom PDF