mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-27 15:24:00 +00:00
Branches: main Fix bug #230. When compiling a sub-module we could incorrectly use the direct argument functor representation for a d.u. functor when: 1. the outer type is defined and exported from an ancestor module, and 2. the functor argument type is defined in the same ancestor module, but the type definition is NOT exported. e.g. :- module ancestor. :- interface. :- type outer ---> f(inner) ; ... . :- type inner. :- implementation. :- type inner ---> inner( ... ). To solve the problem, the sub-module must be able to distinguish between type definitions which are available from the ancestor module's public interface, and type definitions which the ancestor only exported to sub-modules. The distinction was not apparent in the `.int0' private interface files -- all items were contained into a single interface section, no matter where they came from in the original source file. This change separates `.int0' files into two sections: the interface section for items in the public interface, and the implementation section for items in the private interface. compiler/modules.m: Change `.int0' files to have two sections as described. Sort the contents of the individual sections. compiler/add_type.m: Do not let other statuses override `status_imported(import_locn_ancestor_private_interface_proper)'. compiler/make_tags.m: Fix the main bug described. Fix a bug where a type with `status_abstract_exported' was not considered exported-to-submodules, which it is. compiler/prog_data.m: Rename and clarify that `import_locn_ancestor_private_interface_proper' really, really means that it came from the actual, true, and proper private interface of a module and nowhere else. compiler/prog_item.m: Rename `md_private_interface' to what it really means. compiler/equiv_type.m: compiler/hlds_out_pred.m: compiler/hlds_pred.m: compiler/make_hlds_passes.m: compiler/mercury_to_mercury.m: compiler/module_qual.m: Conform to changes. tests/hard_coded/Mmakefile: tests/hard_coded/daf_bug.exp: tests/hard_coded/daf_bug.m: tests/hard_coded/daf_bug_parent.m: tests/hard_coded/daf_bug_sub.m: Add test case. tests/invalid/ii_parent.ii_child.err_exp: Update expected output.