Project

Profile

Help

Bug #3713

closed

Incorrect type inference that element(foo) is a subtype of element(*:bar)

Added by Michael Kay about 6 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2018-03-07
Due date:
% Done:

100%

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

Description

The static type inferencing logic incorrectly deduces that element(foo) is a subtype of element(*:bar)

The reason for this is that we look at the set of names that can be matched. The set of names that element(*:bar) can match is infinite, and therefore we assume that it includes "foo". But of course, it doesn't.

This emerged from a new optimization that rewrites child::foo/self:::bar as child::foo, on the basis that self:::bar does not further restrict the set of nodes selected. But although the optimisation is new (and is correct), the type inferencing code that it relies on has been in the product "for ever", and is flawed.

Please register to edit this issue

Also available in: Atom PDF