-
Notifications
You must be signed in to change notification settings - Fork 89
Refine type printing heuristics in view of #1962 #2105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
72310b7
Print better candidates for printtyp
ncik-roberts f2c68e0
Add tests for underscore criterion
ncik-roberts 4019000
Promote change in test output
ncik-roberts 35fb1ed
Prefer earlier-discovered types to later ones when printing
ncik-roberts e2c8ecb
Suggestion from review
ncik-roberts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
(* See [test_multiple_files.ml]. *) | ||
|
||
module B = struct | ||
type t = B1 | B2 | ||
end | ||
|
||
type _b = B.t = B1 | B2 |
4 changes: 4 additions & 0 deletions
4
ocaml/testsuite/tests/printing-types/test_multiple_files.compilers.reference
This file contains hidden or 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,4 @@ | ||
val other_file_b : Multiple_files.B.t | ||
module A : sig type t = A1 | A2 end | ||
type _a = A.t = A1 | A2 | ||
val this_file_a : A.t |
27 changes: 27 additions & 0 deletions
27
ocaml/testsuite/tests/printing-types/test_multiple_files.ml
This file contains hidden or 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,27 @@ | ||
(* TEST | ||
|
||
readonly_files ="multiple_files.ml" | ||
* setup-ocamlopt.opt-build-env | ||
** ocamlopt.opt | ||
module = "multiple_files.ml" | ||
flags = "-g" | ||
*** ocamlopt.opt | ||
module = "test_multiple_files.ml" | ||
flags = "-short-paths -i" | ||
**** check-ocamlopt.opt-output | ||
*) | ||
|
||
(* Ensure that underscore-prefixed type names | ||
are avoided by the type printer when | ||
a good, underscoreless name is available. | ||
*) | ||
|
||
let other_file_b = Multiple_files.B1 | ||
|
||
module A = struct | ||
type t = A1 | A2 | ||
end | ||
|
||
type _a = A.t = A1 | A2 | ||
|
||
let this_file_a = A1 |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.