2024-11-22 03:57 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000257mercuryBugpublic2013-05-21 14:04
Reporterwangp 
Assigned Tojuliensf 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000257: require_complete_switch var does not appear in sub-goal
DescriptionThe compiler doesn't warn if the variable named in a
require_complete_switch does not appear anywhere in the sub-goal, e.g.

    :- type xyz ---> x ; y ; z.
          
    :- pred oops(xyz::in, int::out) is semidet.
    
    oops(G, N) :-
        require_complete_switch [Gee]
        (
            G = x,
            N = 1
        ;
            G = y,
            fail
        ).
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000520

juliensf (administrator)

Even better, consider what happens (or rather doesn't happen) with:

oops(G, N) :-
        some [Gee]
        (
            G = x,
            N = 1
        ;
            G = y,
            fail
        ).

~0000521

juliensf (administrator)

Fix posted for review.

~0000522

juliensf (administrator)

The compiler now emits a warning in this case.
+Notes

-Issue History
Date Modified Username Field Change
2012-06-22 12:49 wangp New Issue
2013-05-20 16:42 juliensf Note Added: 0000520
2013-05-20 17:48 juliensf Assigned To => juliensf
2013-05-20 17:48 juliensf Status new => assigned
2013-05-20 17:48 juliensf Note Added: 0000521
2013-05-21 14:04 juliensf Note Added: 0000522
2013-05-21 14:04 juliensf Status assigned => resolved
2013-05-21 14:04 juliensf Resolution open => fixed
+Issue History