Mercury Bugs - mercury | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0000575 | mercury | Bug | public | 2024-07-09 17:18 | 2024-07-09 17:18 |
Reporter | wangp | ||||
---|---|---|---|---|---|
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0000575: type qualification scope bug | ||||
Description | Explicit type qualification is processed before quantification, leading to variables being given explicit types without taking into account that variables with the same name might be in different scopes. :- module type_qual_bug. :- interface. :- pred bug1 is det. :- pred bug2 is det. :- implementation. :- type foo1 ---> foo(int). :- type foo2 ---> foo(int). bug1 :- % X is assigned the type foo1 due to an explicit type qualification. % Later, when the Xs are renamed apart, the type is copied over to both % new variables. Obviously, the two Xs are not supposed to be related. some [X] ( X = foo(1) : foo1 ), some [X] ( X = foo(2) : foo2 ). bug2 :- % Both X variables end up with type foo2, so this compiles. % But the type of the first X should be ambiguous. some [X] ( X = foo(1) ), some [X] ( X = foo(2) : foo2 ). | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | type_qual_bug.m (720) 2024-07-09 17:18 https://bugs.mercurylang.org/file_download.php?file_id=331&type=bug |
There are no notes attached to this issue. |
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2024-07-09 17:18 | wangp | New Issue | |||
2024-07-09 17:18 | wangp | File Added: type_qual_bug.m |