From zoltan.somogyi at runbox.com Sun Nov 2 16:16:38 2025 From: zoltan.somogyi at runbox.com (Zoltan Somogyi) Date: Sun, 02 Nov 2025 16:16:38 +1100 (AEDT) Subject: [m-rev.] for post-commit review: specific diagnostics for numeric ops Message-ID: For review by anyone. Zoltan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Log.i Type: application/octet-stream Size: 1195 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: DIFF.i Type: application/octet-stream Size: 27772 bytes Desc: not available URL: From jfischer at opturion.com Sun Nov 2 17:16:55 2025 From: jfischer at opturion.com (Julien Fischer) Date: Sun, 2 Nov 2025 17:16:55 +1100 Subject: [m-rev.] for post-commit review: specific diagnostics for numeric ops In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 at 16:16, Zoltan Somogyi wrote: > Specialize diagnostics for numeric operations. > > compiler/typecheck_error_undef.m: > When users try to use arithmetic operations, bitwise operations, > or comparisons (meaning functions such as '+' or '<<', or predicates > such as '<') without importing any of the modules that define those ops, > generate a diagnostic that explains this specific situation. Mercury > is unusual in requiring such imports, so novices need to have this > pointed out to them. Have these messages replace the less-specific > messages we used to generate in such situations. > > Fix a persistent typo. > > tests/invalid/int_ops.{m,err_exp}: > A new test case for the new diagnostics. > > tests/invalid/Mmakefile: > Enable the new test case. > > tests/invalid/multiply_star.err_exp: > Expect the diagnostic text, and stop expecting the "did you mean" > message that it replaces. > > tests/invalid/multiply_star.err_exp[23]: > Delete these files. They existed only because different sets of imports > with different options yielded different "did you mean" suggestions, > and we don't have those anymore. You may want to include rational in your lists of numeric modules, since it is also numeric and provides many of the operations in question. That looks fine otherwise. Julien.