mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
Estimated hours taken: 2 Fix two bugs in intermodule optimization reported by Warwick Harvey. compiler/intermod.m: Don't read `.opt' files for nested modules. The compiler currently doesn't read in the `.int0' files for parent modules of modules for which `.opt' files are read, resulting in undefined symbol errors. Export predicate `update_error_status' for use by trans_opt.m. compiler/trans_opt.m: Use intermod__update_error_status to check whether an error should be reported if a `.trans_opt' file is not found. This is difficult to write a test case for because it would be spread across multiple directories. compiler/options.m: doc/user_guide.texi: Add option --warn-missing-trans-opt-files. compiler/handle_options: --check-termination implies --warn-missing-trans-opt-files. tests/valid/Mmakefile: tests/valid/intermod_nested_module.m: tests/valid/intermod_nested_module2.m: Test case.
31 lines
362 B
Mathematica
31 lines
362 B
Mathematica
:- module intermod_nested_module2.
|
|
|
|
:- interface.
|
|
|
|
:- type foo.
|
|
|
|
:- module sub_module.
|
|
|
|
:- interface.
|
|
|
|
:- import_module int.
|
|
|
|
:- pred bar(int, foo).
|
|
:- mode bar(in, out) is det.
|
|
|
|
:- end_module sub_module.
|
|
|
|
:- implementation.
|
|
|
|
:- type foo ---> foo(int).
|
|
|
|
:- module sub_module.
|
|
|
|
:- implementation.
|
|
|
|
bar(X, foo(Y)) :-
|
|
Y = X + 1.
|
|
|
|
:- end_module sub_module.
|
|
|