[m-rev.] diff: fix bug in error messages

Julien Fischer juliensf at cs.mu.OZ.AU
Thu May 19 13:23:19 AEST 2005


On Sun, 8 May 2005, Mark Brown wrote:

> Hi,
>
> This fixes a bug that was reported by Rob Moss a while ago.
>
> Cheers,
> Mark.
>
> Estimated hours taken: 0.5
> Branches: main, release
>
> compiler/module_qual.m:
> 	Check for variables used as constructors when module qualifying types
> 	and insts.  In both cases this is currently illegal, so we report a
> 	more sensible error message than we would otherwise get.
>
> compiler/prog_type.m:
> 	Export a test to check if a type uses a variable as a constructor.
>
> tests/invalid/Mmakefile:
> tests/invalid/kind.err_exp:
> tests/invalid/kind.m:
> 	Test case.
>

This change has broken code like that in the attached example where
we define a type like the following:

	:- type '' ---> ''.

and then try to use it.

Julien.
-------------- next part --------------
:- module funny_type.

:- interface.

:- import_module list.

:- type '' ---> ''.

:- pred foo(list('')::out) is det.

:- implementation.

foo(['', '']).


More information about the reviews mailing list