Skip to content

Report failures when resolving references #717

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 4 commits into from
Sep 14, 2021
Merged

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Aug 23, 2021

Closes #664

Add a warning when a reference failed to resolve. Before, this was not reported at all.

Add a warning when a reference couldn't be resolved. The behavior
doesn't change.
@@ -23,30 +23,40 @@ type type_lookup_result =
| `C of class_lookup_result
| `CT of class_type_lookup_result ]

type value_lookup_result = Resolved.Value.t
Copy link
Member

Choose a reason for hiding this comment

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

If we don't need these let's get rid of them rather than just commenting them out.

end

module CT = struct
type t = class_type_lookup_result
(* type t = class_type_lookup_result *)
Copy link
Member

Choose a reason for hiding this comment

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

For these I'm quite tempted to keep the type here as documentation (internal right now, since it's not actually exposed in the interface) - though the alias is not terribly helpful. How about:

type t = Resolved.ClassType.t * Component.ClassType.t

It also might be useful to declare the error type too - again, mainly for documentation purposes. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd too prefer to define this type fully and define class_type_lookup_result as alias to it but I prefer to not duplicate the definition.
I've added back all the types and added an instance of the result type to the first function of every modules (for documentation).

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need class_type_lookup_result - so no duplication needed. I think the only one actually exposed is module_lookup_result

Copy link
Member

Choose a reason for hiding this comment

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

(beyond the fact that they are used in subsequent result types, which we can duplicate in the modules I think)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not exposed but it's used to define type_lookup_result and that's the duplication I would like to avoid. I think it's also useful to show that type_lookup_result is an aggregate of existing return types rather than a new thing.

Copy link
Member

Choose a reason for hiding this comment

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

OK, let's keep this as-is for now, we might still be able to tidy up but it's not a big issue :-)

@jonludlam jonludlam merged commit 9f47d89 into ocaml:master Sep 14, 2021
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Oct 5, 2021
CHANGES:

Breaking changes
- Remove odoc-parser into a separate repository (@jonludlam, ocaml/odoc#700)

Additions
- OCaml 4.13 support (@Octachron, ocaml/odoc#687, ocaml/odoc#689)
- Better errors/warnings (@Julow, ocaml/odoc#692, ocaml/odoc#717, ocaml/odoc#720, ocaml/odoc#732)
- ModuleType 'Alias' support (@jonludlam, ocaml/odoc#703)
- Improved test suite (@lubega-simon, ocaml/odoc#697)
- Improved documentation (@lubega-simon, @jonludlam, ocaml/odoc#702, ocaml/odoc#733)
- Strengthen module types (@jonludlam, ocaml/odoc#731)

Bugs fixed
- `uwt` now can be documented (@jonludlam, ocaml/odoc#708)
- Fix resolution involving deeply nested substitutions (@jonludlam, ocaml/odoc#727)
- Fix off-by-one error in error reporting (@asavahista, ocaml/odoc#736)
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.

Failures when resolving references are not reported
2 participants