Files
mercury/tests/invalid/duplicate_mutable.m
Zoltan Somogyi 94085f5165 Detect and report duplicate mutables.
compiler/add_mutable_aux_preds.m:
    If a mutable has the same name as another mutable defined earlier,
    report this fact, and don't try to implement the mutable. If we did
    try to implement it, we would get a whole slew of errors about
    multiple definitions of all the other kinds of items that we turn
    a mutable definition into.

tests/invalid/duplicate_mutable.{m,err_exp}:
    Add this test case for the diagnostics we generate for this issue.

tests/invalid/Mmakefile:
    Enable the new test case.
2024-06-02 03:44:36 +10:00

18 lines
389 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module duplicate_mutable.
:- interface.
:- type foo.
:- implementation.
:- type foo == int.
:- mutable(global, int, 42, ground, [untrailed]).
:- mutable(global, int, 43, ground, [untrailed]).