mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
This fixes Mantis bug #486. compiler/parse_pragma.m: Read in the name of the type in a foreign enum in whatever qualified form it is in the source code, and then try to implicitly qualify it, generating a specific error message if that attempt is unsuccessful. compiler/parse_sym_name.m: To make the above possible, expose the code that does the implicit qualification. Do so not just in the form now needed by parse_pragma.m, but in the other forms used by other predicates in parse_sym_name.m as well, since they probably will be needed sooner or later. (The lack of such separated-out capability is what led to the code that caused bug 486 in the first place.) Avoid an unneeded asymmetry by providing mechanisms to parse implicitly qualified sym_names without arguments, as well as with arguments. compiler/parse_util.m: Give several of the predicates involved in the above more expressive names. compiler/parse_inst_mode_defn.m: compiler/parse_type_defn.m: compiler/parse_type_repn.m: compiler/recompilation.check.m: Conform to the changes above. compiler/error_util.m: Fix a bug that silently deleted the newly-added simplest_specs, which this diff uses for the first time. Add determinism requirements to avoid similar problems in the future. compiler/add_foreign_enum.m: Note that the old code that diagnosed attempts to define foreign_enums for types in other modules should not be needed anymore. tests/invalid/foreign_enum_import.err_exp: Expect the error message now generated by parse_pragma.m, which is more specific than the one generated by add_foreign_enum.m until now. tests/valid/bug486.m: tests/valid/bug486.window.m: A regression test for the bug. tests/valid/Mmakefile: Enable the new test.
21 lines
620 B
Mathematica
21 lines
620 B
Mathematica
%-----------------------------------------------------------------------------%
|
|
% vim: ft=mercury ts=4 sw=4 et
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% This regression test for Mantis bug #486 is cut down from code that was
|
|
% originally in extras/graphics/mercury_glut/glut.window.m.
|
|
%
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- module bug486.
|
|
:- interface.
|
|
|
|
:- include_module bug486.window.
|
|
:- import_module bug486.window.
|
|
|
|
:- func special_window_state = bug486.window.state.
|
|
|
|
:- implementation.
|
|
|
|
special_window_state = window_height.
|