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

Make it easier to find source of unexpected ability #5536

Open
ceedubs opened this issue Jan 14, 2025 · 1 comment
Open

Make it easier to find source of unexpected ability #5536

ceedubs opened this issue Jan 14, 2025 · 1 comment
Labels
error-message Request for improved error message

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Jan 14, 2025

I often encounter an error message like The expression in red needs the {IO} ability, but this location only has access to these abilities: {g5, Remote, Scope s8}. That's great (aside from some perplexing numbers appended to ability type parameters, but that's a separate issue).

But then when it shows me the offending code, it may be a block that is dozens of lines long. Is there a way that we could make it easier to spot where the offending code is?

image

This may be tricky, because there may be 1 or more nodes/lines requiring 1 or more unexpected abilities. Maybe the all could be highlighted? Even if it's easier to special-case 1 offending node/line, I think it would be pretty helpful.

Environment (please complete the following information):

@ceedubs ceedubs added the error-message Request for improved error message label Jan 14, 2025
@sellout
Copy link
Contributor

sellout commented Feb 10, 2025

Another message I see when I have this same needle-in-a-haystack problem is

When trying to match Mechanism {𝕖1953, 𝕖1954, Exception, Random} {𝕖1788, 𝕖1789, Random} with Mechanism {Random} {Random} the left hand side contained extra abilities: {𝕖1953, 𝕖1954, Exception}

The message isn’t quite as good as the one @ceedubs sees, but I managed to interpret it as “You specified the type Mechanism {Random} {Random}, but the expression has the type Mechanism {Exception, Random} {Random}”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-message Request for improved error message
Projects
None yet
Development

No branches or pull requests

2 participants