Files
mercury/tests/hard_coded/value_enum.m
Peter Wang 6dabc1ce92 In the Java grade, an enumeration is represented by a class with a `value'
Branches: main

In the Java grade, an enumeration is represented by a class with a `value'
field, alongside constants named by the user.  A constant named `value'
would conflict with that field, so we rename it to `MR_value'.

compiler/ml_type_gen.m:
compiler/mlds_to_java.m:
        As above.

tests/hard_coded/Mmakefile:
tests/hard_coded/value_enum.exp:
tests/hard_coded/value_enum.m:
        Add test case.
2009-05-25 02:29:20 +00:00

26 lines
656 B
Mathematica

% The Java backend was using `value' as a field name inside enumeration
% classes, which conflicted with `value' function symbols in Mercury code.
:- module value_enum.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- implementation.
:- type ref_or_value
---> value
; ref.
main(!IO) :-
io.write(value, !IO),
io.nl(!IO).
%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=8 sts=4 sw=4 et