[m-dev.] somewhat misleading error message
Mark Brown
mark at mercurylang.org
Sun Sep 15 10:33:02 AEST 2024
Hi all,
I just got these error messages, the second of which is the right one.
The first confused me a bit as the semidet was inferred and not
something I wrote myself.
Would it be possible to mention in the first message whether the
determinism was declared or inferred? That's likely to be of
assistance to users in this situation, which is probably not that
uncommon (in this case it was because I accidentally re-used a
variable name).
Alternatively, just suppress the message if the determinism is not
declared. An error would be reported at the call site instead, which
may also be confusing, but that's the sort of thing you should expect
if you eschew declaring the determinism :-)
Cheers,
Mark
../../src/pack/flex.rows.layout.m:700: In `pack_flex_item'(in, in, in, in, in,
../../src/pack/flex.rows.layout.m:700: in, out, in, out, in, out, di, uo):
../../src/pack/flex.rows.layout.m:700: error: `semidet' is not a valid
../../src/pack/flex.rows.layout.m:700: determinism for a predicate that has
../../src/pack/flex.rows.layout.m:700: I/O state arguments. The valid
../../src/pack/flex.rows.layout.m:700: determinisms for such predicates are
../../src/pack/flex.rows.layout.m:700: `det', `cc_multi' and `erroneous',
../../src/pack/flex.rows.layout.m:700: since the I/O state can be neither
../../src/pack/flex.rows.layout.m:700: duplicated nor destroyed.
../../src/pack/flex.rows.layout.m:700: In `pack_flex_item'(in, in, in, in, in,
../../src/pack/flex.rows.layout.m:700: in, out, in, out, in, out, di, uo):
../../src/pack/flex.rows.layout.m:700: error: determinism declaration not
../../src/pack/flex.rows.layout.m:700: satisfied.
../../src/pack/flex.rows.layout.m:700: Declared `det', inferred `semidet'.
../../src/pack/flex.rows.layout.m:700: The reason for the difference is the
../../src/pack/flex.rows.layout.m:700: following.
../../src/pack/flex.rows.layout.m:723: In the return value of call to
../../src/pack/flex.rows.layout.m:723: function
../../src/pack/flex.rows.layout.m:723: `pack.used_values.make_used_style'/1:
../../src/pack/flex.rows.layout.m:723: unification with `UsedStyle' can fail.
More information about the developers
mailing list