Project

Profile

Help

Bug #2399

closed

Spurious warning when required type is empty-sequence()

Added by Michael Kay almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
Start date:
2015-06-16
Due date:
% Done:

100%

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

Description

When a template or function declares its required return type as empty-sequence, and the body of the template or function is a single xsl:message instruction, Saxon produces a spurious compile time warning:

Warning: at xsl:message on line 5 of test.xsl:

  Required item type of result of template test is xs:error; supplied value has item type

  xs:anyAtomicType. The expression can succeed only if the supplied value is an empty sequence.

Present in 9.6 but not in 9.5

Actions #1

Updated by Michael Kay almost 9 years ago

  • Status changed from In Progress to Resolved

The error is probably particular to the use of xsl:message, because xsl:message "lies" about its return type (rather than saying it returns empty sequence, it says it returns anyAtomicType?, to prevent the instruction being optimized away).

Changed TypeChecker.staticTypeCheck to avoid doing any checking on item type if the required type is an empty sequence.

Patch committed on 9.6 and 9.7 branches.

Actions #2

Updated by O'Neil Delpratt over 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.7

Bug fix applied in the Saxon 9.6.0.7 maintenance release.

Actions #3

Updated by O'Neil Delpratt over 8 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.7 added
Actions #4

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF