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
Optional argument type not printed #7866
Comments
Comment author: @alainfrisch
I assume that the trouble is that the printer does not have access to the environment in order to unify the argument type with 'a option in order to extract 'a. Is that right? Could one use the environment provided by wrap_printing_env?
Do you mean splitting: | Tarrow of arg_label * type_expr * type_expr * commutable in two constructors (or putting the first type_expr "under" the three constructors), so that the first type_expr can be given a different meaning? |
Comment author: @lpw25
Essentially, although I would phrase it more in terms of wanting type printing to work without needing to perform invasive operations like unification on the types.
I had in mind making the first type_expr part of the label type, and giving it a slightly different meaning in the optional case. It just seems a cleaner representation to me, but its probably a fairly invasive change. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
(reproduced on 4.12) |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Original bug ID: 7866
Reporter: @lpw25
Status: new
Resolution: open
Priority: normal
Severity: minor
Category: typing
Monitored by: antron @nojb
Bug description
In some cases the type of an optional argument cannot be printed.
This is because the type of the argument becomes
'a opt
instead of'a option
. I suspect that the proper fix is to represent the types of optional arguments as'a
instead of'a option
.The text was updated successfully, but these errors were encountered: