[Bug 3669] Type checking of () GeneralOp [value]

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3669





------- Comment #1 from simeon@us.ibm.com  2006-09-26 14:31 -------
Tim,

Since the title of your comment is on General comparisons, I believe you meant
to say '() = 1' ?

I am not sure I understand what the problem you are trying to point out is.

The normalization should be indeed what you suggest:

some $v1 in fn:data(()) satisfies
some $v2 in fn:data(1) satisfies
let $u1 := fs:convert-operand($v1, $v2) return
let $u2 := fs:convert-operand($v2, $v1) return
fs:eq ($u1, $u2)

The inference should go as follows:

() has type empty
fn:data(()) has type empty
the some expression is typed through a prime type. so $v1 will
be of type 'none' which should make sure the rest of the
type checking succeeds. This is because in fact 'some' does
not iterate at all over the empty sequence, the rest of the
expression will not even be evaluated.
the final type for the expression should be xs:boolean.

- Jerome

Received on Tuesday, 26 September 2006 14:46:57 UTC