using Saxon 8.1.1, consider the following XQuery:
1 >= ()
It results in net.sf.saxon.xpath.StaticError: Cannot compare xs:integer to empty()
Thanks. This problem seems to have gone away in Saxon 8.2. I have added a test case so it doesn't recurr.