Skip to content
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

Use identical variant names for arg_label and arg_label_loc. #7254

Closed
wants to merge 1 commit into from

Conversation

cristianoc
Copy link
Collaborator

In several places, additional type annotations need to be added to disambiguate which definition is used: with or without location. In exchange, the naming is uniform.

In several places, additional type annotations need to be added to disambiguate which definition is used: with or without location.
In exchange, the naming is uniform.
@@ -952,7 +952,9 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
(* compute the application of the first label, then the next ones *)
let args = processApply args [label] in
processApply args nextLabels
| (Asttypes.Nolabel, _) :: nextArgs, [Asttypes.Nolabel] -> nextArgs
| ( ((Nolabel : Asttypes.arg_label), _) :: nextArgs,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of extra type annotations.

@@ -169,8 +169,8 @@ let printSignature ~extractor ~signature =
labelDecl.ld_type
in
let lblName = labelDecl.ld_id |> Ident.name in
let lbl =
if labelDecl.ld_optional then Asttypes.Optional lblName
let lbl : Asttypes.arg_label =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another example of annotation required.

@cristianoc
Copy link
Collaborator Author

Closing as this is superseded by the better solution in #7247

@cristianoc cristianoc closed this Jan 29, 2025
@cristianoc cristianoc deleted the alias-label-variant-names branch January 29, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant