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.)

Actions #1

Updated by Michael Kay over 2 years ago

  • Status changed from New to Resolved
  • Applies to branch trunk added
  • Fix Committed on Branch 10, trunk added

In line with other type errors, this is now a warning if the operand expression could be an empty sequence.

Actions #2

Updated by Michael Kay over 2 years ago

Added QT3 test cases Lookup-228 and -229.

Actions #3

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.6 added

Bug fix applied in the Saxon 10.6 maintenance release

Please register to edit this issue

Also available in: Atom PDF