[Bug 3686] fn-matches2args-1 fails static typechecking.

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





------- Comment #2 from mike@saxonica.com  2006-09-08 16:24 -------
> fn:matches(xs:string("This is a characte"),xs:string("This is a characte"))

If this isn't a valid query then we've clearly got something badly wrong, and
it's not just the test case. 

Static Typing is identified in the CR as an "at risk" feature and this kind of
report is leading me strongly to the view that we should pull it from the Rec
and take more time to get it right.

IIRC, there was some pressure from Static Typing implementors to relax the
signatures of some functions and operators (like matches) so that queries like
the one above would work, and there was resistance from other implementors
because it would reduce the ability for dynamic typing to detect errors.
Perhaps we should think about allowing functions and operations to have a
weaker type signature when static typing is in use. Or perhaps we need to make
the type inference machinery more intelligent so that it (like any human being)
can infer that the above example is actually type safe.

Michael Kay
(not speaking for the WG, of course)

Received on Friday, 8 September 2006 16:26:53 UTC