type not available during computation of function caching

Bug #1001463 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Matthias Brantner

Bug Description

The following query and schema cause an error to be raised because the schema type doesn't seem to be available when trying to determine if function caching should be done.

import schema namespace d = "http://foo.com/schemas/schema" at "schema.xsd";

declare function local:recursion($param as element(*, d:Content)?) as xs:boolean
{
  if ($param)
  then local:recursion(())
  else false()
};

local:recursion(<d:Content id="foo"/>)

<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://foo.com/schemas/schema"
  xmlns = "http://foo.com/schemas/schema"
           xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <xs:complexType name="Content">
      <xs:attribute name="id" type="xs:string"></xs:attribute>
    </xs:complexType>

</xs:schema>

The error reported is:

type error [err:XPTY0004]: "[NodeXQType elementNode? content=[UserDefinedXQType Content@http://foo.com/schemas/schema isComplex emptyContent base:[XQType ANY_TYPE_KIND*] ]]": invalid type: not among in-scope schema types; raised at /home/mbrantner/zorba/sandbox/src/types/typeops.cpp:522

Related branches

Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.