Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove ambiguity from "not safe to write" compiler error message #4299

Merged
merged 12 commits into from
Jan 17, 2023

Conversation

kidandcat
Copy link
Contributor

@kidandcat kidandcat commented Jan 9, 2023

Fixes #4290

With this change, the error becomes:

Error:
/Users/jairocaro-accinoviciana/issues-pony-4290/demo.pony:10:11: not safe to write right side to left side
    x.foo = foo
          ^
    Info:
    /Users/jairocaro-accinoviciana/issues-pony-4290/demo.pony:9:14: right side type: Foo ref
        let foo: Foo ref = Foo
                 ^
    /Users/jairocaro-accinoviciana/issues-pony-4290/demo.pony:10:5: left side type: X iso
        x.foo = foo
        ^

(First time contributing to ponyc + first time contributing in C) triple check the change please 😅

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 9, 2023
@kidandcat kidandcat changed the title fix vague error message Fix vague error message Jan 9, 2023
@SeanTAllen
Copy link
Member

This should have a test.

@SeanTAllen SeanTAllen removed the discuss during sync Should be discussed during an upcoming sync label Jan 10, 2023
@kidandcat kidandcat requested a review from SeanTAllen January 11, 2023 09:15
@SeanTAllen
Copy link
Member

@jemc @jasoncarr0 because i got turned around a little with this, can one of you review this as well?

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 11, 2023
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Jan 13, 2023
@ponylang-main
Copy link
Contributor

Hi @kidandcat,

The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 4299.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@@ -0,0 +1,3 @@
## Fix vague error message when it is not safe to write

Added left side type to a "not safe to write" error message.
Copy link
Member

Choose a reason for hiding this comment

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

This is likely to be lacking in meaning for a reader of the release notes who doesn't have your context.

Please include what the error message used to be, why that was vague, and how the new version of the message fixes the vagueness.

@SeanTAllen SeanTAllen changed the title Fix vague error message Remove ambiguity from "not safe to write" compiler error message Jan 17, 2023
kidandcat and others added 3 commits January 17, 2023 18:23
Co-authored-by: Sean T Allen <sean@seantallen.com>
@SeanTAllen SeanTAllen merged commit 238b29a into ponylang:main Jan 17, 2023
github-actions bot pushed a commit that referenced this pull request Jan 17, 2023
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jan 17, 2023
github-actions bot pushed a commit that referenced this pull request Jan 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vague error messages when it is not safe to write
5 participants