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

Warnings referring to source locations in Cryptol prelude are big, ugly and not reproducible #569

Closed
brianhuffman opened this issue Feb 8, 2019 · 3 comments
Assignees
Labels
feature request Asking for new or improved functionality

Comments

@brianhuffman
Copy link
Contributor

I was thinking of adding a regression test for #568, but it doesn't really work because the expected output has a warning with unpredictable content. For example, here's what I got this time:

Cryptol> ~ 0x4 where complement x = x
[warning] at <interactive>:1:13--1:23
    This binding for complement shadows the existing binding from
    (at /var/folders/hf/g8kjlj3x4cz05819qsk684_c0000gp/T/Cryptol5521-0.cry:109:11--109:21, complement)
0xb

Next time I start cryptol and run this, I'll get a different temporary file name; if someone else runs it, they'll probably get a completely different temporary directory too.

Maybe it would be better to clean up the printing of locations from the cryptol prelude, or to have a special way of printing them.

@yav
Copy link
Member

yav commented Feb 8, 2019

Once we do renaming earlier, we could also enforce that the built-in syntax always refers to the definitions from the Prelude, so this would be less of an issue.

Still, I wonder if as a first step we change the messages to print the module name instead of the file name?

@brianhuffman
Copy link
Contributor Author

As of b1edb9e, built-in syntax does always refer to the definitions from the Prelude; I just ran into this problem trying to add a regression test.

Also, I've definitely seen this kind of warning message in other places. For example, in user code that reuses a common name like sum, etc.

@brianhuffman
Copy link
Contributor Author

As far as changing the message to print the module name instead: I think the filename is generally useful, so that the user can load the file and look at the particular line. It's just not as useful when the filename is a randomly generated temp file.

Do we have a recommended way for users to load up and view (a copy of) the Cryptol prelude in an editor? The warning message should help users do whatever the recommended way is to do that.

@yav yav added the feature request Asking for new or improved functionality label Jul 5, 2019
@yav yav self-assigned this Jul 5, 2019
@yav yav closed this as completed in 8fe9f5e Jul 5, 2019
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