mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 12:26:29 +00:00
Estimated hours taken: 0.5 compiler/intermod.m: Append the variable numbers to variables in the clauses written to `.opt' files. This fixes a bug which caused type errors to be reported for predicates in a `.opt' file. The problem was that the names of the DCG variables inside a DCG pred expression clashed with the DCG variables of the enclosing clause. tests/valid/Mmakefile: tests/valid/intermod_dcg_bug.m: tests/valid/intermod_dcg_bug2.m: Test case.
22 lines
536 B
Mathematica
22 lines
536 B
Mathematica
% Mercury ROTD 2/8/2000 reported a type error when typechecking
|
|
% the clauses for foo/2 from intermod_dcg_bug2.opt.
|
|
% The problem was that the DCG arguments introduced for the
|
|
% DCG pred expressions clashed with the DCG arguments for
|
|
% the enclosing clauses. The solution was to add variable numbers
|
|
% to clauses in `.opt' files.
|
|
%
|
|
:- module intermod_dcg_bug.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state, io__state).
|
|
:- mode main(di, uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module intermod_dcg_bug2.
|
|
|
|
main --> foo.
|