mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-28 07:44:43 +00:00
Estimated hours taken: 10 Branches: main Fixes to allow testing of `ground' matches `bound'. compiler/modules.m: When writing discriminated union types to the .int2 file, write out the full type definition rather than an abstract type declaration. This is necessary because a module which transitively imports the .int2 file may need to know the constructors to allow `ground' to be compared with `bound' insts. See the new test case `transitive_inst_type' for an example. If the type has user-defined equality and/or comparison predicates then we write "... where type_is_abstract_noncanonical" to the .int2 file instead of giving the predicate names. compiler/make_hlds.m: If a discriminated union type is imported from a .int2 file, mark it as `abstract_imported'. compiler/typecheck.m: When type checking var-functor unifications, do not allow functors whose types are `abstract_imported', unless we are type checking an `opt_imported' predicate. compiler/prog_data.m: Add a new alternative `abstract_noncanonical_type' to the type `unify_compare' to represent "where type_is_abstract_noncanonical" annotations read from .int2 files. compiler/prog_io.m: Parse "where type_is_abstract_noncanonical" annotations on discriminated union types. compiler/special_pred.m: compiler/unify_proc.m: Avoid creating unification and comparison predicates for types with `type_is_abstract_noncanonical' annotations. compiler/intermod.m: Handle the change to the `unify_compare' type. compiler/type_util.m: Do not remove module qualifiers from constructors before looking them up in the cons table. Some cons ids only have the qualified version in the table. tests/hard_coded/Mmakefile: tests/hard_coded/Mercury.options: tests/hard_coded/transitive_inst_type.exp: tests/hard_coded/transitive_inst_type.m: tests/hard_coded/transitive_inst_type2.m: tests/hard_coded/transitive_inst_type3.m: tests/hard_coded/trans_intermod_user_equality.exp: tests/hard_coded/trans_intermod_user_equality.m: tests/hard_coded/trans_intermod_user_equality2.m: tests/hard_coded/trans_intermod_user_equality3.m: Add some test cases.
16 lines
273 B
Mathematica
16 lines
273 B
Mathematica
:- module trans_intermod_user_equality.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
:- pred main(io::di, io::uo) is cc_multi.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module trans_intermod_user_equality2.
|
|
|
|
main -->
|
|
{ make_bar(0, 1, Bar) },
|
|
{ use_bar(Bar, N) },
|
|
io__write_int(N),
|
|
io__nl.
|