-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: when pretty printing constant names, do not use aliases from "no…
…n-API `export`s" (#5689) This PR adjusts the way the pretty printer unresolves names. It used to make use of all `export`s when pretty printing, but now it only uses `export`s that put names into parent namespaces (heuristic: these are "API exports" that are intended by the library author), rather than "horizontal exports" that put the names into an unrelated namespace, which the dot notation feature in #6189 now incentivizes. Closes the already closed #2524
- Loading branch information
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/-! | ||
# Pretty printing shouldn't make use of "non-API exports" | ||
-/ | ||
|
||
namespace A | ||
def n : Nat := 22 | ||
end A | ||
|
||
namespace B | ||
export A (n) | ||
end B | ||
|
||
/-! | ||
Was `B.n` | ||
-/ | ||
/-- info: A.n : Nat -/ | ||
#guard_msgs in #check (A.n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters