Mercury Bugs - mercury
View Issue Details
0000420mercuryBugpublic2016-09-14 16:062016-09-19 14:31
Reporterwangp 
Assigned Towangp 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000420: try goals lost in .opt files
Description`try' goals are not written out to .opt files. When the body is open coded into the caller, any exceptions that it was supposed to catch would not be caught.

This is similar to bug 0000391 for trace goals.

The test case currently produces this in the .opt file:

try_goal_opt.bad_try(V_5, V_6, V_10, V_11) :-
    ( % try
      % io(V_10, V_11)
      exception.magic_exception_result(V_12),
      ( % disjunction
        V_12 = exception.succeeded(V_14) : exception.exception_result({}),
        V_14 = {} : {},
        some [] (
          V_15 = V_10,
          call(V_5, V_8, V_15, V_11)
        ),
        some [] (
          V_6 = V_8
        )
      ;
        V_12 = exception.exception(V_13) : exception.exception_result({}),
        V_9 = exception.exc_univ_value(V_13),
        exception.throw(V_9),
        V_11 = V_10
      )
    ).
TagsNo tags attached.
Attached Files? try_goal_opt.m (403) 2016-09-14 16:06
https://bugs.mercurylang.org/file_download.php?file_id=264&type=bug

Notes
(0000910)
wangp   
2016-09-19 14:31   
Fixed by commit 1e0025b

Issue History
2016-09-14 16:06wangpNew Issue
2016-09-14 16:06wangpFile Added: try_goal_opt.m
2016-09-16 14:36wangpAssigned To => wangp
2016-09-16 14:36wangpStatusnew => assigned
2016-09-19 14:31wangpStatusassigned => resolved
2016-09-19 14:31wangpResolutionopen => fixed
2016-09-19 14:31wangpNote Added: 0000910