Artifacts Associated With Ticket 219150
Ticket change [6c4144718a] (rid 128469) by nobody on 2000-10-26 05:02:20:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1149 Bug Version: 8.1b1 SubmitDate: '1999-02-02' LastModified: '2000-05-19' Severity: MED Status: Assigned Submitter: pat ChangedBy: hobbs RelatedBugIDs: 2248 OS: Linux Machine: Other FixedDate: '1999-04-09' ClosedDate: '2000-10-25' Name: Steve McAndrewSmith ReproducibleScript: # These work fine catch { expr 1+1 } ;# no error catch { someundefinedproc } ;# error, but caught # These don't! (the error is never caught) catch { expr 1+- } catch { expr int(abc) } ObservedBehavior: When "expr" generates a syntax error, it is not caught by the "catch" command. DesiredBehavior: Duh. :-) Catch should behave the same for "expr" as for any other error. 03/24/1999 14:23 - stanton - This is the expected (if non-obvious) behavior. The syntax error is detected during compilation of the catch command, so it cannot be masked. This is a change from 8.0 and should be documented more clearly. --- 04/09/1999 14:43 - surles - Added necessary documentation and an example. -- This was originally noted fixed in 8.1b3, but it is actually a bug, not a doc problem. The work-around is to do: set cmd {expr 1+-} catch $cmd -- 05/19/2000 hobbs - foundin initialized to: "obsolete: 8.1b1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "10. Objects"
- title initialized to: ""catch" doesn't catch "expr" syntax errors"
- type initialized to: "Bug"
Ticket change [f5b88e265b] (rid 130164) by dkf on 2000-11-08 18:56:51:
- foundin changed to: "obsolete: 8.3.2"
- icomment:
Problem still exists. :^(
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "dkf"
Ticket change [09e4dbc57e] (rid 113729) by dgp on 2000-11-09 02:55:44:
- assignee changed to: "dgp"
- closedate changed to: "2000-11-08T19:55:44"
- closer changed to: "dgp"
- icomment:
According to the release notes accompanying Tcl 8.0, this is not a bug, but a known incompatibility with Tcl 7 introduced by the bytecode compiler. Point 2 on page http://dev.scriptics.com/doc/compiler.html reads: ... 2.Catch no longer catches compilation errors One consequence of the fact that in Tcl 8.0 compilation errors in scripts are returned immediately is that catch no longer prevents compilation errors from aborting command interpretation. For example, catch {set} immediately reports the error wrong # args: should be "set varName ?newValue?" To have catch handle compile time errors, give it a script that is only determined at runtime: for example, catch [concat {set}] ... Perhaps this incompatibility wasn't a good idea, but it's known and documented, so it's not a bug. I'm marking this Invalid and Closing it. If you want this changed, file a TIP. - login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dgp"