mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 05:13:48 +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.
26 lines
1.7 KiB
Plaintext
26 lines
1.7 KiB
Plaintext
method_impl.m:025: Warning: the type class `method_impl.c'/1 and the type
|
||
method_impl.m:025: constructor in the argument vector of this instance
|
||
method_impl.m:025: declaration for it, namely `method_impl.foo'/0, are all
|
||
method_impl.m:025: visible outside this module, which means that this
|
||
method_impl.m:025: instance can be relevant outside this module. [38;5;87mKeeping it[39;49m
|
||
method_impl.m:025: [38;5;87mprivate[39;49m to this module is therefore [38;5;203mlikely to be a[39;49m
|
||
method_impl.m:025: [38;5;203mmistake.[39;49m
|
||
method_impl.m:026: In clause for instance method predicate `m1'/2:
|
||
method_impl.m:026: in argument 2 of predicate `method_impl.foo_m1'/2:
|
||
method_impl.m:026: type error: [38;5;87mvariable `HeadVar__2'[39;49m has type
|
||
method_impl.m:026: [38;5;203mint;[39;49m
|
||
method_impl.m:026: expected type was
|
||
method_impl.m:026: [38;5;40mstring.[39;49m
|
||
method_impl.m:026: The partial type assignment was:
|
||
method_impl.m:026: HeadVar__1_1: method_impl.foo
|
||
method_impl.m:026: HeadVar__2_2: int
|
||
method_impl.m:028: Warning: the type class `method_impl.c'/1 and the type
|
||
method_impl.m:028: constructor in the argument vector of this instance
|
||
method_impl.m:028: declaration for it, namely `method_impl.bar'/0, are all
|
||
method_impl.m:028: visible outside this module, which means that this
|
||
method_impl.m:028: instance can be relevant outside this module. [38;5;87mKeeping it[39;49m
|
||
method_impl.m:028: [38;5;87mprivate[39;49m to this module is therefore [38;5;203mlikely to be a[39;49m
|
||
method_impl.m:028: [38;5;203mmistake.[39;49m
|
||
method_impl.m:029: In clause for instance method predicate `m1'/2:
|
||
method_impl.m:029: error: call to [38;5;203mundefined[39;49m predicate [38;5;87m`bar_m1'/2.[39;49m
|