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

The warnDefaulting option doesn't affect some REPL printing #543

Closed
atomb opened this issue Jul 27, 2018 · 5 comments
Closed

The warnDefaulting option doesn't affect some REPL printing #543

atomb opened this issue Jul 27, 2018 · 5 comments
Assignees
Milestone

Comments

@atomb
Copy link
Contributor

atomb commented Jul 27, 2018

For example:

Cryptol> :set warnDefaulting=off
Cryptol> 42 : [_]
Showing a specific instance of polymorphic result:
  * Using '6' for type wildcard (_)
0x2a
Cryptol> 42
Showing a specific instance of polymorphic result:
  * Using 'Integer' for type argument 'rep' of 'Cryptol::number'
42
Cryptol>

Maybe the warnDefaulting option should control these messages, too? These are, of course, messages that are specific to the REPL. Does warnDefaulting only apply to defaulting that occurs during normal type checking?

@yav
Copy link
Member

yav commented Jul 28, 2018

Yes, warnDefaulting currenly only suppresses the actual warnings generated during type checking.

These messages are not really warnings, but rather it is Cryptol reporting on what it's doing, much like when it says "Loading...". I can see how they look similar to the other warnings though, even thought the algorithm used is quite different.

I don't have a strong opinion if this behavior should be controlled by warDefaulting or another flag.

@brianhuffman
Copy link
Contributor

I checked with version 2.5.0, and its behavior matches the current behavior: warnDefaulting=off suppresses only the warnings for defaulting during type checking; it does not suppress the message when you ask to evaluate a polymorphic thing and it picks a type instance for you. So at least this is not a regression.

I guess we could do one of three things:

  1. Make warnDefaulting suppress REPL defaulting as well
  2. Make a new :set option to suppress only REPL defaulting messages
  3. Do nothing

None of these would be hard to do. Probably the hardest part of 2 would be choosing the name of the new option.

@yav
Copy link
Member

yav commented Aug 15, 2018

Does anyone have a strong preference on this? I am leaning towards 1, for simplicity. My thinking is that if you don't care about defaulting in your source code, you probably don't care about the slightly different version at the command line either, and 1 is that path of least surprise, even though it is a little less flexible than 2.

@atomb
Copy link
Contributor Author

atomb commented Aug 16, 2018

I'd lean toward 1, as well. It seems like the path of least surprise, as you say.

@atomb atomb added this to the 2.6.1 milestone Aug 21, 2018
@brianhuffman brianhuffman self-assigned this Sep 4, 2018
@brianhuffman
Copy link
Contributor

I'll go ahead and implement option 1.

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

No branches or pull requests

3 participants