Hi,

I have a specific piece of code which fails to run as expected. Unfortunately i didn't manage to create an MCVE so far.
The part of code that should fail in my script is:

    some $i in $data satisfies starts-with($i, $string)

Where $data is a list of strings, and $string is a sequence of two strings - example ("S1", "S2"). The Query executes without error, but the trace message is never visible.
The part of the Query plan that executes successfully (while it shouldn't) is:

  <StaticFunc name="common:startsWith" type="xs:boolean" arg0="elements" arg1="string">
    <GFLWOR type="xs:boolean" size="1">
      <Let type="xs:string*">
        <Var name="$string" id="178" type="xs:string*"/>
        <FnTrace name="trace(value[,label])" type="xs:string*">
          <StaticFuncCall name="common:string" tailCall="false" type="xs:string*">
            <VarRef>
              <Var name="$string" id="177" type="item()*" promote="true"/>
            </VarRef>
          </StaticFuncCall>
          <Str type="xs:string">STRING: </Str>
        </FnTrace>
      </Let>
      <Quantifier option="some" type="xs:boolean" size="1">
        <GFLWOR type="xs:boolean*">
          <For type="xs:string" size="1">
            <Var name="$i" id="180" type="xs:string"/>
            <StaticFuncCall name="common:string" tailCall="false" type="xs:string*">
              <VarRef>
                <Var name="$elements" id="176" type="item()*" promote="true"/>
              </VarRef>
            </StaticFuncCall>
          </For>
          <FnTrace name="trace(value[,label])" type="xs:boolean" size="1">
            <FnStartsWith name="starts-with(string,sub[,collation])" type="xs:boolean" size="1">
              <VarRef type="xs:string" size="1">
                <Var name="$i" id="180" type="xs:string"/>
              </VarRef>
              <VarRef type="xs:string*">
                <Var name="$string" id="178" type="xs:string*"/>
              </VarRef>
            </FnStartsWith>
            <Str type="xs:string">SATISFY: </Str>
          </FnTrace>
        </GFLWOR>
      </Quantifier>
    </GFLWOR>
  </StaticFunc>

I'm not sure if you can find anything from the Query plan for why this is happening. This fails either with or without inlining.
Regards,

George