mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 14:57:03 +00:00
Estimated hours taken: 3 Branches: main Catch errors concerning pragma export and model_non code earlier than we do at the moment. Currently, we just generate #error directives in the C code and let the C preprocessor report the error. compiler/make_hlds.m: Emit an error message if pragma export is used on a procedure that has a declared determinism of multi or nondet. compiler/det_analysis.m: compiler/det_report.m: As above, but handle the case where the determinism needs to be inferred. compiler/export.m: Abort rather than trying to generate code for model_non pragma exports. tests/invalid/Mmakefile: tests/invalid/invalid_export_detism.err_exp: tests/invalid/invalid_export_detism.m: Test case for the above.
17 lines
217 B
Mathematica
17 lines
217 B
Mathematica
:- module invalid_export_detism.
|
|
|
|
:- interface.
|
|
|
|
:- pred foo(int::in, int::out) is nondet.
|
|
|
|
:- implementation.
|
|
|
|
:- pragma export(foo(in, out), "EXPORTED_FOO").
|
|
|
|
foo(1, 2).
|
|
foo(2, 3).
|
|
foo(3, 4).
|
|
foo(3, 5).
|
|
foo(3, 6).
|
|
|