Mercury Bugs - mercury
View Issue Details
0000530mercuryFeature Requestpublic2021-02-26 18:032022-01-25 01:41
Reporterzs 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000530: diagnose inapplicable insts in mode declarations
DescriptionThis is (or was) real code from library/hash_table.m:

:- pred update_item_in_bucket(K, V, hash_bucket(K, V), hash_bucket(K, V)).
:- mode update_item_in_bucket(in(hb_two_plus), in, in, out) is semidet
:- mode update_item_in_bucket(in, in, in, out) is semidet.

The in(hb_two_plus) was intended to be applied to the third argument,
the initial hash bucket, not to the key, whose type is unknown, and is
extremely unlikely to be a hash bucket of any size :-(

The compiler should check whether the modes of arguments in mode declarations
match the types (if any) of the corresponding arguments, and generate
error messages for any mismatches.
TagsNo tags attached.
Attached Files

Notes
(0001160)
zs   
2022-01-25 01:41   
Feature implemented on 2021 dec 30.

Issue History
2021-02-26 18:03zsNew Issue
2022-01-25 01:41zsAssigned To => zs
2022-01-25 01:41zsStatusnew => resolved
2022-01-25 01:41zsResolutionopen => fixed
2022-01-25 01:41zsNote Added: 0001160