-
Notifications
You must be signed in to change notification settings - Fork 123
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
Expand private type synonyms #485
Comments
Instead, we could just report this situation as an error: You are not allowed to mention a private type synonym in the signature of an exported function. |
There are some other corner cases to consider: What if the type of a function |
There are also two levels of strictness we could enforce:
|
A desired property of the type pretty-printer is that if you print a type, you should be able to cut and paste the type and cryptol should be able to parse it back in. |
I think the easiest thing to do here is to modify the pretty printer so that it will only print a type synonym if the name is currently in scope, and simply recurse into the body of the type definition otherwise. A quick look in the code leads me to believe all the necessary information is already available in the proper places. |
I have a patch for this, which is just waiting in line behind some other PRs. |
This behavior was intentionally changed by the fix for #485.
This behavior was intentionally changed by the fix for #485.
This behavior was intentionally changed by the fix for #485.
This is more of an improvement than a bug.
Consider the following example:
In this case we are exporting
f
, but not the type synonymT
. This is questionable practice, but I think that in this case, Cryptol should exportf
with type[8]
rather than[A::T]
. This type is equivalent, and the idea is that if the type synonym is not exported, then it should not be used when reporting types.The text was updated successfully, but these errors were encountered: