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

Awkward error message for incompatible fixities #590

Closed
brianhuffman opened this issue Apr 28, 2019 · 2 comments
Closed

Awkward error message for incompatible fixities #590

brianhuffman opened this issue Apr 28, 2019 · 2 comments
Assignees
Labels
feature request Asking for new or improved functionality

Comments

@brianhuffman
Copy link
Contributor

For example:

cryptol> :t \a b c d -> a == b || b == c

[error]
    The fixities of (at <interactive>:1:15--1:17, (==)) and
    (at <interactive>:1:25--1:27, (==)) are not compatible.
    You may use explicit parenthesis to disambiguate

It is very weird to read a noun phrase starting with "at"; the operator is the important bit and it should come first. Also the last sentence should use plural "parentheses" and have a period.

I would prefer this:

[error]
    The fixities of (==) (at <interactive>:1:15--1:17) and
    (==) (at <interactive>:1:25--1:27) are not compatible.
    You may use explicit parentheses to disambiguate.
@brianhuffman
Copy link
Contributor Author

Actually, it would be even better to print not just the operators, but also the fixities/precedence levels in the error message itself. Maybe something like:

[error] at <interactive>:1:15--1:17 and <interactive>:1:25--1:27
    The fixities of (==) (precedence 20, non-associative) and
    (==) (precedence 20, non-associative) are not compatible.
    You may use explicit parentheses to disambiguate.

@yav yav added the feature request Asking for new or improved functionality label May 14, 2019
brianhuffman pushed a commit that referenced this issue Jun 24, 2019
@brianhuffman
Copy link
Contributor Author

@yav suggested using a bulleted list to make the error message easier to read. As of eb7b74a, the error message looks like this:

Cryptol> True == False != True

[error] at <interactive>:1:6--1:8 and <interactive>:1:15--1:17
    The fixities of
      • (==) (precedence 20, non-associative)
      • (!=) (precedence 20, non-associative)
    are not compatible.
    You may use explicit parentheses to disambiguate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Asking for new or improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants