Here's another one:
for $n in (<a/>, <b/>) let $f := function() as element()* { trace($n) } return $f()
It seems as if the combination of trace() and the wildcard in the function return type causes this bug. I have just another GitHub issue [1].
Thanks, Christian
[1] https://github.com/BaseXdb/basex/issues/1023
On Sat, Nov 8, 2014 at 10:49 AM, Rob Stapper r.stapper@lijbrandt.nl wrote:
Hi Christian,
Attached the most reduced version with wrong result.
Success ;-)
Rob
*Van:* Christian Grün [mailto:christian.gruen@gmail.com] *Verzonden:* vrijdag 7 november 2014 18:04 *Aan:* Rob Stapper *CC:* BaseX *Onderwerp:* Re: [basex-talk] unexpected behaviour
Hi Rob,
thanks for the example code. Could you possibly reduce it to a shorter snippet that still demonstrates the surprising behavior?
Best,
Christian
On Fri, Nov 7, 2014 at 6:00 PM, Rob Stapper r.stapper@lijbrandt.nl wrote:
Hi,
Running the attached program produces the next evaluation.
Evaluating:
elementSeq: <A ref="var1"><B><X1/></B></A>
content0: <X1/>
content2: <X1/>
elementSeq: <A ref="var1"><B><X2/></B></A>
content0: <X2/>
content2: <X1/>
I can’t explain the value of the last “- content2: ”-trace.
I expect it to be the same value as the last “- content0: ”-trace.
What’s happening here?
- Rob Stapper
[image: Afbeelding verwijderd door afzender.] http://www.avast.com/
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus http://www.avast.com/ actief is.
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus http://www.avast.com/ actief is.