Skip to content

Conversation

@rhendric
Copy link
Member

@rhendric rhendric commented Jun 22, 2021

Description of the change

This is the PR I expressed an intention to make in #4096 (comment); see also #4096 (comment).

The intent here is to exclude any instance names that the user wouldn't recognize because they were generated by the compiler. Either these names can be dropped altogether because the error message is positioned on the offending instance, or they should be replaced with a suitable description of the instance.

I believe this covers all of the error messages that currently mention instance names.

The specific formatting of the errors is very much up for discussion. I'm not thrilled with how verbose they are, but I also don't know what I'd cut from them.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@rhendric rhendric force-pushed the rhendric/anonymous-instance-error-messages branch 2 times, most recently from 12acbfd to 2369530 Compare June 22, 2021 03:07
@JordanMartinez
Copy link
Contributor

The code looks right. I'm still looking at the error messages.

As an example, I tried removing the special characters in TypeSynonymsOverlappingUnnamedInstance.purs. I'm not sure if I did it correctly, but this is what an error message might look like:

Error found:
in module Mai
at tests/purs/failing/TypeSynonymsOverlappingUnnamedInstance.purs:14:1 - 15:16 (line 14, column 1 - line 15, column 16)
  Overlapping type class instances found for

    Main.Convert String 
                 String

  The following instances were found:

    instance in module Main with type Convert String String (line 11, column 1 - line 12, column 16)
    instance in module Main with type Convert String String (line 14, column 1 - line 15, column 16)

in type class instance

  Main.Convert String 
               String

See https://github.com/purescript/documentation/blob/master/errors/OverlappingInstances.md for more information,
or to contribute content related to this error.

Copy link
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@rhendric rhendric mentioned this pull request Jun 26, 2021
4 tasks
@rhendric rhendric merged commit 7f4aea4 into purescript:master Jun 26, 2021
@rhendric rhendric deleted the rhendric/anonymous-instance-error-messages branch June 26, 2021 16:36
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.

3 participants