use space.thing
module space of
@public use Thing as thing
data Thing: Type of
(Relevant) stderr:
error[E009]: re-export of the more private binding `topmost.space.Thing`
--> a.lushui:1:11
|
1 | use space.thing
| ^^^^^ re-exporting binding with greater exposure
|
--> a.lushui:4:10
|
4 | data Thing: Type of
| ----- re-exported binding with lower exposure
|
note: expected the exposure of `topmost.thing`
to be at most `topmost.space`
but it actually is `topmost`
error[E009]: re-export of the more private binding `topmost.space.Thing`
--> a.lushui:3:26
|
3 | @public use Thing as thing
| ^^^^^ re-exporting binding with greater exposure
|
--> a.lushui:4:10
|
4 | data Thing: Type of
| ----- re-exported binding with lower exposure
|
note: expected the exposure of `topmost.space.thing`
to be at most `topmost.space`
but it actually is unrestricted
Ideally, it should only report:
error[E009]: re-export of the more private binding `topmost.space.Thing`
--> a.lushui:3:26
|
3 | @public use Thing as thing
| ^^^^^ re-exporting binding with greater exposure
|
--> a.lushui:4:10
|
4 | data Thing: Type of
| ----- re-exported binding with lower exposure
|
note: expected the exposure of `topmost.space.thing`
to be at most `topmost.space`
but it actually is unrestricted
The cause of the bug is collapse_use_chain which loses the information of whether a binding is a direct or a transitive use.
If we remove the collapsing logic in collapse_use_chain (but keeping the UnresolvedUseBinding logic), the bug goes away.
However, everything else breaks like the check if something is a namespace or not which assumes collapsed uses (obviously; as designed).
Example to reproduce:
(Relevant) stderr:
Ideally, it should only report:
The cause of the bug is
collapse_use_chain
which loses the information of whether a binding is a direct or a transitive use. If we remove the collapsing logic incollapse_use_chain
(but keeping the UnresolvedUseBinding logic), the bug goes away. However, everything else breaks like the check if something is a namespace or not which assumes collapsed uses (obviously; as designed).