[Bug 16370] New: Does a TryCatch expression catch a type error raised during the static analysis phase?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16370

           Summary: Does a TryCatch expression catch a type error raised
                    during the static analysis phase?
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: ghislain.fourny@28msec.com
         QAContact: public-qt-comments@w3.org


In section 2.3.1 (Kinds of errors) it is said that "a type error may be raised
during the static analysis phase or the dynamic evaluation phase."

Section 3.15 (TryCatch Expressions) says

1. "A try/catch expression catches dynamic errors and type errors raised during
dynamic evaluation for expressions that are lexically contained within the try
clause,"
2. "if the target expression raises a dynamic error or a type error, [catch
clause evaluated]" (with no further precision on type error)
3. "Static errors are not caught by the try/catch expression."

I am a bit unsure about when type errors are caught, as I could not find a
specific sentence for type errors raised statically (maybe I just missed it).

If we distinguish between type errors raised statically and those raised
dynamically, it might lead to a behavior which is hard to predict within an
implementation and between implementations.

Should we make a try catch expression also catch type errors when they are
raised during the static analysis phase (in which case, as a rule of thumb, I
guess an optimizer could replace the trycatch expression with the matching
catch expression)?

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 14 March 2012 16:00:05 UTC