Files
mercury/tests/valid/intermod_dcg_bug.m
Simon Taylor f89c62ad40 Append the variable numbers to variables in the clauses
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.
2000-08-04 23:58:49 +00:00

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.