-
Notifications
You must be signed in to change notification settings - Fork 8
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
Merge 5.2.0minus-5 #124
base: main
Are you sure you want to change the base?
Merge 5.2.0minus-5 #124
Conversation
14d1873
to
2678281
Compare
I'm a bit confused by the CI failure. The same test passes when I run locally, and I haven't yet been able to reproduce. This test has been known to be flaky in the past, so I re-ran it twice, but there's two test cases that have consistently failed across all three runs. I'm tempted to comment out those tests for now so that they don't block rolling Merlin (the justification being that they were already flaky before). |
Those tests shouldn't be flaky -- they're an output of type-checking, which should be deterministic. That said, I'm not shocked that this has changed as we've evolved the type checked. The tests are looking to see where we allocate a cell that never gets used, which is a bit unusual. I think it's fine to accept the new output. But I wouldn't comment out the tests! |
@@ -240,7 +240,7 @@ Syntax errors also shouldn't escape: | |||
"line": 1, | |||
"col": 41 | |||
}, | |||
"type": "parser", | |||
"type": "typer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good reason for this change?
:: (_, node) | ||
:: _parents -> | ||
let loc = Mbrowse.node_loc node_for_loc in | ||
(loc, Construct.node ~config ~keywords ?depth ~values_scope node) | ||
| (_, (Browse_raw.Expression { exp_desc = Texp_hole; _ } as node)) | ||
| ( _, | ||
(Browse_raw.Expression { exp_desc = Texp_typed_hole | Texp_hole _; _ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really want Texp_hole
? That surprises me a bit.
let lbl = Env.find_label_by_name ident env in | ||
let module Pack = struct | ||
(* This gadt is used to mint the existential type [rep] *) | ||
type t = P : 'rep Types.gen_label_description -> t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't you use packed_label_description
defined above?
| `Description lbls -> | ||
| No -> [] | ||
| Maybe -> | ||
Env.fold_labels Legacy add_label_description prefix_path env [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to make a function the folds over both flavors of label? That will make it less likely to skip one flavor.
Merge flambda changes for 5.2.0minus-5. The first two commits run the import script and commit merge conflicts - I recommend skipping them when reviewing.
This PR was difficult for two reasons:
overwrite (3,4) with (_, 5)
. New nodes are added to the parsetree and typedtree:Pexp_hole
andTexp_hole
, respectively. This partially conflicts with Merlin's idea of typed holes. Before, Merlin used an extension node to represent holes in the parsetree, and in the typedtree, it also added aTexp_hole
constructor. I resolve this by using the newPexp_hole
in place of an extension node (soPexp_hole
represents either type of hole) and renaming Merlin'sTexp_hole
toTexp_typed_hole
(thus, there is now bothTexp_hole
andTexp_typed_hole
in Merlin). I've submitted a PR to upstream Merlin to renameTexp_hole
toTexp_typed_hole
to mitigate conflicts in the future. (I also renamedTmod_hole
toTmod_typed_hole
for consistency - I included this in the upstream PR as well.)