Skip to content

Conversation

@robsimmons
Copy link
Contributor

@robsimmons robsimmons commented Dec 27, 2025

This PR introduces a new error explanation for possibly-too-high inferred universes, with the goal of shortening a long but important error explanation. (The theory is that an example is worth several dozen words.)

@robsimmons robsimmons requested a review from kmill December 27, 2025 17:35
@robsimmons robsimmons changed the title Add a 'highInferredUniverse' error explanation. feat: add a 'highInferredUniverse' error explanation. Dec 27, 2025
@robsimmons robsimmons changed the title feat: add a 'highInferredUniverse' error explanation. feat: add a 'highInferredUniverse' error explanation Dec 27, 2025
@david-christiansen david-christiansen added the HTML available HTML has been generated for this PR label Dec 27, 2025
Copy link
Contributor

@kmill kmill left a comment

Choose a reason for hiding this comment

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

Here are some possibilities to clarify some of the explanations. They're not meant to be edits, just some additional draft material.

Comment on lines +125 to +127
In this case, the error message is a false positive, but the issue can be easily fixed with
clarifying annotations. After annotating Foo with a universe `u`, the overall type can be assigned
type that the error message suggests, which silences the error.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking of modifying the universe level inference algorithm to use a different error here, a simple universe level metavariable error localized to the binder. I think we talked a bit about how it's weird that it creates universe level parameters for constructor fields — this isn't something that should be done automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's great — error explanation pages can be valuable even or especially if the error message sometimes appears in wonky places. If you change the error message in this kind of example, then it'll make sense to just remove the example from the manual page.

robsimmons and others added 3 commits January 11, 2026 18:54
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
@github-actions
Copy link
Contributor

Preview for this PR is ready! 🎉 (also as a proofreading version). built with commit 3b93aa9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HTML available HTML has been generated for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants