mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 04:43:53 +00:00
This implements some improvements to its idea from 2022 mar 19 on m-rev.
compiler/check_typeclass.m:
Consider an instance justifiably kept private if a constraint
on the instance refers to a private type class or type constructor.
Extend the test for what is considered "private" to also include
classes and type constructs that are defined in private submodules
of the current module.
Extend the text of the warning to explain the reasoning behind it.
compiler/options.m:
Extend the documentation of the option to explain the reasoning
behind it.
tests/invalid/impure_method_impl.err_exp:
tests/invalid/inconsistent_instances.err_exp:
tests/invalid/method_impl.err_exp:
tests/invalid/mpj_3.err_exp:
tests/invalid/mpj_4.err_exp:
tests/invalid/range_restrict.err_exp:
tests/warnings/unused_interface_import.err_exp:
Expect the new text for the warning.
tests/warnings/help_text.err_exp:
Expect the new help text.
22 lines
1.7 KiB
Plaintext
22 lines
1.7 KiB
Plaintext
impure_method_impl.m:025: Warning: the type class `impure_method_impl.c'/1 and
|
||
impure_method_impl.m:025: the type constructor in the argument vector of this
|
||
impure_method_impl.m:025: instance declaration for it, namely
|
||
impure_method_impl.m:025: `impure_method_impl.foo'/0, are all visible outside
|
||
impure_method_impl.m:025: this module, which means that this instance can be
|
||
impure_method_impl.m:025: relevant outside this module. [38;5;87mKeeping it private[39;49m to
|
||
impure_method_impl.m:025: this module is therefore [38;5;203mlikely to be a mistake.[39;49m
|
||
impure_method_impl.m:026: Error: instance method predicate [38;5;87m`m1'/2[39;49m is [38;5;203msemipure.[39;49m
|
||
impure_method_impl.m:026: It must either be [38;5;40mdeclared semipure,[39;49m or [38;5;40mpromised[39;49m
|
||
impure_method_impl.m:026: [38;5;40mpure.[39;49m
|
||
impure_method_impl.m:026: In call to semipure predicate
|
||
impure_method_impl.m:026: [38;5;87m`impure_method_impl.foo_m1'/2:[39;49m
|
||
impure_method_impl.m:026: purity error: call [38;5;203mmust be preceded by a `semipure'[39;49m
|
||
impure_method_impl.m:026: [38;5;203mindicator.[39;49m
|
||
impure_method_impl.m:027: Error: instance method predicate [38;5;87m`m2'/2[39;49m is [38;5;203mimpure.[39;49m It
|
||
impure_method_impl.m:027: must either be [38;5;40mdeclared impure,[39;49m or [38;5;40mpromised[39;49m
|
||
impure_method_impl.m:027: [38;5;40msemipure.[39;49m
|
||
impure_method_impl.m:027: In call to impure predicate
|
||
impure_method_impl.m:027: [38;5;87m`impure_method_impl.foo_m2'/2:[39;49m
|
||
impure_method_impl.m:027: purity error: call [38;5;203mmust be preceded by an `impure'[39;49m
|
||
impure_method_impl.m:027: [38;5;203mindicator.[39;49m
|