mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 06:14:18 +00:00
Currently, if a foreign_enum pragma is missing cases in the constructor -
foreign value mapping we report that there are some missing foreign values but
do not list the affected constructors unless --verbose-error-messages is
enabled. For cases where there are a small number of missing foreign values
this is a bit irritating as you need to recompile to find out what they are.
Change the compiler so the error message lists upto the first 10 constructors
that do not have a foreign value.
(If --verbose-error-messages is enabled then we list all of them as before.)
compiler/add_foreign_enum.m:
Make the above change.
In error messages for foreign_enum and foreign_export_enum pragmas, add
the word "type" before the name that is printed in error messages.
tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
tests/fe_unmapped_nonverbose.{m,err_exp}:
tests/fe_napped_verbose.{m,err_exp}:
Test the new error messages for missing constructors in the constructor -
foreign value mapping.
tests/invalid/ee_invalid.err_exp:
tests/invalid/foreign_enum_import.err_exp:
tests/invalid/foreign_enum_invalid.err_exp:
Conform to the above changes.
5 lines
230 B
Plaintext
5 lines
230 B
Plaintext
foreign_enum_import.m:014: In `:- pragma foreign_enum' declaration for type
|
|
foreign_enum_import.m:014: `bool.bool'/0:
|
|
foreign_enum_import.m:014: error: `bool.bool'/0 is not defined in this
|
|
foreign_enum_import.m:014: module.
|