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
Terminating semi-colon ignored by -strict-sequence #7193
Comments
Comment author: @garrigue There seems to be a misunderstanding here. I see no simple way to enforce the result type of a function to be unit, out of adding a type annotation. |
Comment author: @lpw25
Sorry, my description was not clear. I was referring to the |
Comment author: @damiendoligez I agree this would be desirable, but I think it'll involve non-trivial changes to the parser so don't hold your breath. |
Comment author: @gasche Or: do push for a menhir parser when the time to discuss integration comes, to make non-trivial changes great again. |
Comment author: @alainfrisch See #522 . I don't think that Menhir would make this any easier, honestly. |
Comment author: @alainfrisch Considering the amount of changes that were required on the ocaml code base itself to compile after this change, it seems this would likely break many packages around. Time for a -really-strict-sequence mode? |
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. |
If I understand correctly, currently One issue is that there is no obvious way to do this without changing the AST format. Currently we have One could consider, as an alternative, desugaring Finally, we could also consider desugaring |
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: 7193
Reporter: @lpw25
Status: acknowledged (set by @damiendoligez on 2016-03-24T18:19:11Z)
Resolution: open
Priority: normal
Severity: feature
Target version: undecided
Category: typing
Related to: #6961
Monitored by: @gasche @diml @jmeber @hcarty
Bug description
I think that when strict sequence is turned on, the following code:
let f foo bar =
let a =
foo ();
bar ();
in
a;;
should have type:
val f : (unit -> unit) -> (unit -> unit) -> unit =
rather than the current:
val f : (unit -> unit) -> (unit -> 'a) -> 'a =
as this would be more consistent.
It somewhat depends on how you think of strict sequence, but I think one reasonable meaning is "force things before semi-colons to have type unit" and, for this meaning, the above is a bug.
The text was updated successfully, but these errors were encountered: