[m-rev.] for review: fix bug #257

Julien Fischer jfischer at opturion.com
Tue May 21 12:43:56 AEST 2013



On Tue, 21 May 2013, Peter Wang wrote:

> On Mon, 20 May 2013 17:44:43 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> For review by anyone.
>>
>> Branches: master, 13.05
>>
>> -------------------
>>
>> Fix bug #257.
>>
>> Emit a warning if the variable that is the subject of a require_complete_switch
>> scope does not occur in the sub-goal.
>>
>> compiler/det_report.m:
>>  	As above.
>>
>> tests/valid/Mmakefile:
>> tests/valid/bug257b.{m,exp}:
>> tests/warnings/Mmakefile:
>> tests/warnings/bug257.{m,exp}:
>>  	Test cases for the above.
>>
>> Julien.
>>
> ...
>> diff --git a/tests/valid/bug257b.m b/tests/valid/bug257b.m
>> new file mode 100644
>> index 0000000..e3dbbca
>> --- /dev/null
>> +++ b/tests/valid/bug257b.m
>> @@ -0,0 +1,23 @@
>> +% Don't emit an erroneous warning about the variable that is the subject
>> +% of a require_complete_switch scope not occurring in the sub-goal if
>> +% the sub-goal in question is not a switch and the varialbe in question
>
> variable

Fixed.

>> +% does not occur in the non-local set of the sub-goal.
>> +% (See also tests/warning/bug257b.m.)
>
> tests/warnings/bug257.m

Fixed.

...

>> diff --git a/tests/warnings/Mmakefile b/tests/warnings/Mmakefile
>> index c712e31..0225d6f 100644
>> --- a/tests/warnings/Mmakefile
>> +++ b/tests/warnings/Mmakefile
>> @@ -14,6 +14,7 @@ COMPILE_PROGS=	\
>>
>>   ERRORCHECK_PROGS= \
>>   	ambiguous_overloading \
>> +	bug257 \
>>   	det_infer_warning \
>>   	double_underscore \
>>   	duplicate_call \
>> diff --git a/tests/warnings/bug257.exp b/tests/warnings/bug257.exp
>> new file mode 100644
>> index 0000000..270c61d
>> --- /dev/null
>> +++ b/tests/warnings/bug257.exp
>> @@ -0,0 +1,2 @@
>> +bug257.m:015: Warning: variable `Gee' in require_complete_switch scope does
>> +bug257.m:015:   does not occur in the goal.
>
> Maybe:
>
>    Warning: variable `Gee' is the subject of a require_complete_switch
>    scope but does not occur in the sub-goal.

Ok, although I went with "...but it does not occur in the sub-goal.".

Cheers,
Julien.



More information about the reviews mailing list